--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
      name:  <unnamed>
       log:  C:\Users\brian\Dropbox (Personal)\Research\Argentina - Domestic workers reform\Paper\Cluster at MSA\JHR\Accepted\Replication do files/Feld - Domestic workers refor
> m.log
  log type:  text
 opened on:  26 Apr 2022, 19:13:40

. 
. *** Define the control group to use: blue collar workers in the service sector for main tables
. 
. global ctrl_group bluecol_service

. 
. 
. do "$dir/(1) Figures.do"

. ********************************************************************************
. *************************** Do File (1): Figures *******************************
. ********************************************************************************
. 
. clear

. set more off

. 
. use "$data/EPH_1015_format.dta", clear

. 
. destring occupation occupation_unemp occup_all, replace
occupation: all characters numeric; replaced as long
(759813 missing values generated)
occupation_unemp: all characters numeric; replaced as long
(1246493 missing values generated)
occup_all: all characters numeric; replaced as long
(731803 missing values generated)

. 
. *** Keep only observations that have all the controls used
. 
. keep if (occupation !=. & underemp != . & cont_pens !=. & domwk_all !=. & linc_mjob_base08 !=. & lwagehr_mjob_base08 !=. & linc_total_base08 != . & lhours_mjob !=. & age !=. 
> & hhsize !=. & tenure !=. & msa !=. & educyr !=. ///
> & attsch_ever !=. & native !=. & lit !=. & gender !=.) | (occupation_unemp != . & age !=. & hhsize !=. & msa !=. & educyr !=. & attsch_ever !=. & native !=. & lit !=. & gende
> r !=.)
(1,088,326 observations deleted)

. 
. keep if gender == 0
(15,433 observations deleted)

. 
. ********************************************************************************
. ********************************************************************************
. 
. *** Locals for controls
. 
. local occup occupation

. local base_controls "msa year"

. local controls "age age2 hhsize lit native attsch_ever educyr educyr2 i.marstat i.dec_pcfaminc"

. 
. local treatFE "y2010_dwall y2011_dwall y2013_dwall y2014_dwall y2015_dwall"

. 
. ********************************************************************************
. ********************************************************************************
. ********************************************************************************
. 
. * Run regression for pension contribution to restrict the sample to use
. 
. qui reghdfe cont_pens domwk_all treat_dwall `controls' if ${ctrl_group} == 1 & unemployed == 0, absorb(`base_controls' `occup') vce(cluster msa)

. gen sample_reg = 1 if e(sample)
(115,782 missing values generated)

. 
. ********************************************************************************
. ********************************************************************************
. 
. ** Figure 1: Number of houses where a domestic worker is employed
. 
. cap graph drop before_reform after_reform

. histogram n_employers if treat == 0 & sample_reg == 1, discrete frac start(1) width(1) lw(none) fcolor(teal) graphregion(fcolor(white) lcolor(white)) ///
> ylabel(,nogrid angle(horizontal)) plotregion(margin(b=0)) xscale(range(1 10)) xlabel(1(1)10)nodraw name(before_reform) subtitle("Before the reform")
(start=1, width=1)

. histogram n_employers if treat == 1 & sample_reg == 1, discrete frac start(1) width(1) lw(none) fcolor(teal) graphregion(fcolor(white) lcolor(white)) ///
> ylabel(,nogrid angle(horizontal)) plotregion(margin(b=0)) xscale(range(1 10)) xlabel(1(1)10)nodraw name(after_reform) subtitle("After the reform")
(start=1, width=1)

. graph combine before_reform after_reform, graphregion(fcolor(white) lcolor(white))

. graph export "$figures/Feld-figure-1-original.tif", replace width(1200) height(900)
(note: file C:\Users\brian\Dropbox (Personal)\Research\Argentina - Domestic workers reform\Paper\Cluster at MSA\JHR\Accepted\Replication do files/Figures/Feld-figure-1-original
> .tif not found)
(file C:\Users\brian\Dropbox (Personal)\Research\Argentina - Domestic workers reform\Paper\Cluster at MSA\JHR\Accepted\Replication do files/Figures/Feld-figure-1-original.tif w
> ritten in TIFF format)

. 
. cap graph drop before_reform after_reform

. histogram n_employers if treat == 0 & sample_reg == 1, discrete frac start(1) width(1) lw(none) fcolor(black) graphregion(fcolor(white) lcolor(white)) ///
> ylabel(,nogrid angle(horizontal)) plotregion(margin(b=0)) xscale(range(1 10)) xlabel(1(1)10)nodraw name(before_reform) subtitle("Before the reform")
(start=1, width=1)

. histogram n_employers if treat == 1 & sample_reg == 1, discrete frac start(1) width(1) lw(none) fcolor(black) graphregion(fcolor(white) lcolor(white)) ///
> ylabel(,nogrid angle(horizontal)) plotregion(margin(b=0)) xscale(range(1 10)) xlabel(1(1)10)nodraw name(after_reform) subtitle("After the reform")
(start=1, width=1)

. graph combine before_reform after_reform, graphregion(fcolor(white) lcolor(white))

. graph export "$figures/Feld-figure-1-originalbw.tif", replace width(1200) height(900)
(note: file C:\Users\brian\Dropbox (Personal)\Research\Argentina - Domestic workers reform\Paper\Cluster at MSA\JHR\Accepted\Replication do files/Figures/Feld-figure-1-original
> bw.tif not found)
(file C:\Users\brian\Dropbox (Personal)\Research\Argentina - Domestic workers reform\Paper\Cluster at MSA\JHR\Accepted\Replication do files/Figures/Feld-figure-1-originalbw.tif
>  written in TIFF format)

. 
. 
. ********************************************************************************
. ********************************************************************************
. 
. ** Figure 2: Hours of work per week of domestic workers before and after the reform
. 
. twoway (histogram hours_mjob if domwk == 1 & treat == 0 & sample_reg == 1, start(0) w(5) lcolor(black) lw(vthin) fcolor(none)) ///
> (histogram hours_mjob if domwk == 1 & treat == 1 & sample_reg == 1, start(0) w(5) lcolor(none) lw(vthin) fcolor(teal%30) xtitle("Hours of work per week")), ///
> graphregion(fcolor(white) lcolor(white)) xscale(range(0 85)) xlabel(0(10)85) ylabel(,nogrid angle(horizontal)) legend(order(1 "Before the reform" 2 "After the reform")) plotr
> egion(margin(b=0))

. graph export "$figures/Feld-figure-2-original.tif", replace width(1200) height(900)
(note: file C:\Users\brian\Dropbox (Personal)\Research\Argentina - Domestic workers reform\Paper\Cluster at MSA\JHR\Accepted\Replication do files/Figures/Feld-figure-2-original
> .tif not found)
(file C:\Users\brian\Dropbox (Personal)\Research\Argentina - Domestic workers reform\Paper\Cluster at MSA\JHR\Accepted\Replication do files/Figures/Feld-figure-2-original.tif w
> ritten in TIFF format)

. 
. twoway (histogram hours_mjob if domwk == 1 & treat == 0 & sample_reg == 1, start(0) w(5) lcolor(black) lw(vthin) fcolor(none)) ///
> (histogram hours_mjob if domwk == 1 & treat == 1 & sample_reg == 1, start(0) w(5) lcolor(none) lw(vthin) fcolor(black%50) xtitle("Hours of work per week")), ///
> graphregion(fcolor(white) lcolor(white)) xscale(range(0 85)) xlabel(0(10)85) ylabel(,nogrid angle(horizontal)) legend(order(1 "Before the reform" 2 "After the reform")) plotr
> egion(margin(b=0))

. graph export "$figures/Feld-figure-2-originalbw.tif", replace width(1200) height(900)
(note: file C:\Users\brian\Dropbox (Personal)\Research\Argentina - Domestic workers reform\Paper\Cluster at MSA\JHR\Accepted\Replication do files/Figures/Feld-figure-2-original
> bw.tif not found)
(file C:\Users\brian\Dropbox (Personal)\Research\Argentina - Domestic workers reform\Paper\Cluster at MSA\JHR\Accepted\Replication do files/Figures/Feld-figure-2-originalbw.tif
>  written in TIFF format)

. 
. ********************************************************************************
. ********************************************************************************
. 
. ** Figure 3: Index of searches for "domestic worker" over time
. 
. preserve

. 
. clear

. import delimited "$data/Google trends.csv", clear delimiter(",")
(2 vars, 66 obs)

. 
. gen month2 = monthly(month,"YM")

. format month2 %tm

. 
. twoway line serviciodomesticoargentina month2, ytitle("Search index") ylabel(,nogrid angle(horizontal)) xtitle("Month") graphregion(fcolor(white) lcolor(white)) lcolor(black)

. graph export "$figures/Feld-figure-3-originalbw.tif", replace width(1200) height(900)
(note: file C:\Users\brian\Dropbox (Personal)\Research\Argentina - Domestic workers reform\Paper\Cluster at MSA\JHR\Accepted\Replication do files/Figures/Feld-figure-3-original
> bw.tif not found)
(file C:\Users\brian\Dropbox (Personal)\Research\Argentina - Domestic workers reform\Paper\Cluster at MSA\JHR\Accepted\Replication do files/Figures/Feld-figure-3-originalbw.tif
>  written in TIFF format)

. 
. restore

. 
. ********************************************************************************
. ********************************************************************************
. 
. ** Figure 4: Share of registered workers
. 
. * Run regressions to get the DiD coefficients to include in the graphs
. 
. local app replace

. 
. foreach var of varlist cont_pens lhours_mjob linc_mjob_base08 lwagehr_mjob_base08 linc_alljob_base08 linc_total_base08 lhours_alljob lwagehr_alljob_base08 {
  2. 
.         qui reghdfe `var' domwk_all `treatFE' `controls' if sample_reg == 1, absorb(`base_controls' `occup') vce(cluster msa)
  3.         regsave y2010_dwall y2011_dwall y2013_dwall y2014_dwall y2015_dwall using "$data/did_coefs", ci `app' addlabel(outcome, "`var'")
  4.         
.         local app append
  5. }
file C:\Users\brian\Dropbox (Personal)\Research\Argentina - Domestic workers reform\Paper\Cluster at MSA\JHR\Accepted\Replication do files/Data/did_coefs.dta saved
file C:\Users\brian\Dropbox (Personal)\Research\Argentina - Domestic workers reform\Paper\Cluster at MSA\JHR\Accepted\Replication do files/Data/did_coefs.dta saved
file C:\Users\brian\Dropbox (Personal)\Research\Argentina - Domestic workers reform\Paper\Cluster at MSA\JHR\Accepted\Replication do files/Data/did_coefs.dta saved
file C:\Users\brian\Dropbox (Personal)\Research\Argentina - Domestic workers reform\Paper\Cluster at MSA\JHR\Accepted\Replication do files/Data/did_coefs.dta saved
(note: variable outcome was str18, now str19 to accommodate using data's values)
file C:\Users\brian\Dropbox (Personal)\Research\Argentina - Domestic workers reform\Paper\Cluster at MSA\JHR\Accepted\Replication do files/Data/did_coefs.dta saved
(note: variable outcome was str17, now str19 to accommodate using data's values)
file C:\Users\brian\Dropbox (Personal)\Research\Argentina - Domestic workers reform\Paper\Cluster at MSA\JHR\Accepted\Replication do files/Data/did_coefs.dta saved
(note: variable outcome was str13, now str19 to accommodate using data's values)
file C:\Users\brian\Dropbox (Personal)\Research\Argentina - Domestic workers reform\Paper\Cluster at MSA\JHR\Accepted\Replication do files/Data/did_coefs.dta saved
file C:\Users\brian\Dropbox (Personal)\Research\Argentina - Domestic workers reform\Paper\Cluster at MSA\JHR\Accepted\Replication do files/Data/did_coefs.dta saved

. 
. preserve

. 
. 
. use "$data/did_coefs", clear

. 
. keep var coef ci_lower ci_upper outcome

. 
. rename var year

. 
. foreach yr in 2010 2011 2013 2014 2015 {
  2.     
.         replace year = "`yr'" if year == "y`yr'_dwall"
  3.         
. }
(8 real changes made)
(8 real changes made)
(8 real changes made)
(8 real changes made)
(8 real changes made)

. 
. destring year, replace
year: all characters numeric; replaced as int

. replace outcome = "linc_total" if outcome == "linc_total_base08"
(5 real changes made)

. replace outcome = "linc_allj" if outcome == "linc_alljob_base08"
(5 real changes made)

. replace outcome = "lwagehr_mjob" if outcome == "lwagehr_mjob_base08"
(5 real changes made)

. replace outcome = "linc_mjob" if outcome == "linc_mjob_base08"
(5 real changes made)

. replace outcome = "lwagehr_allj" if outcome == "lwagehr_alljob_base08"
(5 real changes made)

. 
. 
. reshape wide coef ci_lower ci_upper, i(year) j(outcome) string
(note: j = cont_pens lhours_alljob lhours_mjob linc_allj linc_mjob linc_total lwagehr_allj lwagehr_mjob)

Data                               long   ->   wide
-----------------------------------------------------------------------------
Number of obs.                       40   ->       5
Number of variables                   5   ->      25
j variable (8 values)           outcome   ->   (dropped)
xij variables:
                                   coef   ->   coefcont_pens coeflhours_alljob ... coeflwagehr_mjob
                               ci_lower   ->   ci_lowercont_pens ci_lowerlhours_alljob ... ci_lowerlwagehr_mjob
                               ci_upper   ->   ci_uppercont_pens ci_upperlhours_alljob ... ci_upperlwagehr_mjob
-----------------------------------------------------------------------------

. 
. 
. tempfile did_coefficients

. save `did_coefficients'
file C:\Users\brian\AppData\Local\Temp\ST_2840_000003.tmp saved

. 
. restore

. 
. preserve

. 
. keep if sample_reg == 1
(115,782 observations deleted)

. 
. collapse (mean) cont_pens linc_mjob_base08 lwagehr_mjob_base08 lhours_mjob lhours_alljob linc_alljob_base08 lwagehr_alljob_base08 linc_total_base08, by(year domwk)

. 
. format cont_pens %9.2f

. 
. merge m:1 year using `did_coefficients'

    Result                           # of obs.
    -----------------------------------------
    not matched                             2
        from master                         2  (_merge==1)
        from using                          0  (_merge==2)

    matched                                10  (_merge==3)
    -----------------------------------------

. 
. foreach var of varlist coefcont_pens coeflhours_alljob coeflhours_mjob coeflinc_allj coeflinc_mjob coeflinc_total coeflwagehr_allj coeflwagehr_mjob {
  2.     
.         replace `var' = 0 if `var' == .
  3. }
(2 real changes made)
(2 real changes made)
(2 real changes made)
(2 real changes made)
(2 real changes made)
(2 real changes made)
(2 real changes made)
(2 real changes made)

. 
. twoway (scatter cont_pens year if domwk == 0, m(s) mc(purple) c(line) lpattern(dash) lcolor(purple)) (scatter cont_pens year if domwk == 1, m(o) mc(maroon) c(line) lcolor(mar
> oon)) ///
> (scatter coefcont_pens year if domwk == 0, yaxis(2) m(X) mc(blue)) (rcap ci_lowercont_pens ci_uppercont_pens year if domwk == 0, yaxis(2) lcolor(blue)), ///
> legend(order (1 "Low-wage female workers" 2 "Female domestic workers" 3 "DiD coefficient" 4 "95% CI" )) xtitle("Year") xline(2012, lcolor(red)) xlabel(2010(1)2015) ///
> ytitle("DiD coefficient", axis(2)) ylabel(,angle(horizontal) axis(1)) ylabel(,angle(horizontal) axis(2)) ytitle("Share formal") graphregion(fcolor(white) lcolor(white)) 

. graph export "$figures/Feld-figure-4-original.tif", replace width(930) height(600)
(note: file C:\Users\brian\Dropbox (Personal)\Research\Argentina - Domestic workers reform\Paper\Cluster at MSA\JHR\Accepted\Replication do files/Figures/Feld-figure-4-original
> .tif not found)
(file C:\Users\brian\Dropbox (Personal)\Research\Argentina - Domestic workers reform\Paper\Cluster at MSA\JHR\Accepted\Replication do files/Figures/Feld-figure-4-original.tif w
> ritten in TIFF format)

. 
. twoway (scatter cont_pens year if domwk == 0, m(s) mc(black) c(line) lpattern(dash) lcolor(black)) (scatter cont_pens year if domwk == 1, m(o) mc(black) c(line) lcolor(black)
> ) ///
> (scatter coefcont_pens year if domwk == 0, yaxis(2) m(X) mc(black)) (rcap ci_lowercont_pens ci_uppercont_pens year if domwk == 0, yaxis(2) lcolor(black)), ///
> legend(order (1 "Low-wage female workers" 2 "Female domestic workers" 3 "DiD coefficient" 4 "95% CI" ) span) xtitle("Year") xline(2012, lcolor(blac)) xlabel(2010(1)2015) ///
> ytitle("DiD coefficient", axis(2)) ylabel(,angle(horizontal) axis(1)) ylabel(,angle(horizontal) axis(2)) ytitle("Share formal") graphregion(fcolor(white) lcolor(white)) 
(note:  named style blac not found in class color, default attributes used)

. graph export "$figures/Feld-figure-4-originalbw.tif", replace width(930) height(600)
(note: file C:\Users\brian\Dropbox (Personal)\Research\Argentina - Domestic workers reform\Paper\Cluster at MSA\JHR\Accepted\Replication do files/Figures/Feld-figure-4-original
> bw.tif not found)
(file C:\Users\brian\Dropbox (Personal)\Research\Argentina - Domestic workers reform\Paper\Cluster at MSA\JHR\Accepted\Replication do files/Figures/Feld-figure-4-originalbw.tif
>  written in TIFF format)

. 
. 
. ********************************************************************************
. ********************************************************************************
. 
. ** Figure 5: Means of labor market outcomes per year and occupation
. 
. * Panel A: Hours of work per week on main job
. 
. twoway (scatter linc_mjob_base08 year if domwk == 0, m(s) mc(purple) c(line) lpattern(dash) lcolor(purple)) (scatter linc_mjob_base08 year if domwk == 1, m(o) mc(maroon) c(li
> ne) lcolor(maroon)) ///
> (scatter coeflhours_mjob year if domwk == 0, yaxis(2) m(X) mc(blue)) (rcap ci_lowerlhours_mjob ci_upperlhours_mjob year if domwk == 0, yaxis(2) lcolor(blue)), ///
> legend(order (1 "Low-wage female workers" 2 "Female domestic workers" 3 "DiD coefficient" 4 "95% CI") span) xtitle("Year") xline(2012, lcolor(red)) xlabel(2010(1)2015) title(
> "Panel A: Hours of work per week in main job") ///
> ytitle("DiD coefficient", axis(2)) ylabel(,angle(horizontal) axis(1)) ylabel(,angle(horizontal) axis(2)) ytitle("Log hours") graphregion(fcolor(white) lcolor(white)) 

. graph export "$figures/Feld-figure-5a-original.tif", replace width(930) height(600)
(note: file C:\Users\brian\Dropbox (Personal)\Research\Argentina - Domestic workers reform\Paper\Cluster at MSA\JHR\Accepted\Replication do files/Figures/Feld-figure-5a-origina
> l.tif not found)
(file C:\Users\brian\Dropbox (Personal)\Research\Argentina - Domestic workers reform\Paper\Cluster at MSA\JHR\Accepted\Replication do files/Figures/Feld-figure-5a-original.tif 
> written in TIFF format)

. 
. twoway (scatter linc_mjob_base08 year if domwk == 0, m(s) mc(black) c(line) lpattern(dash) lcolor(black)) (scatter linc_mjob_base08 year if domwk == 1, m(o) mc(black) c(line)
>  lcolor(black)) ///
> (scatter coeflhours_mjob year if domwk == 0, yaxis(2) m(X) mc(black)) (rcap ci_lowerlhours_mjob ci_upperlhours_mjob year if domwk == 0, yaxis(2) lcolor(black)), ///
> legend(order (1 "Low-wage female workers" 2 "Female domestic workers" 3 "DiD coefficient" 4 "95% CI") span) xtitle("Year") xline(2012, lcolor(black)) xlabel(2010(1)2015) titl
> e("Panel A: Hours of work per week in main job") ///
> ytitle("DiD coefficient", axis(2)) ylabel(,angle(horizontal) axis(1)) ylabel(,angle(horizontal) axis(2)) ytitle("Log hours") graphregion(fcolor(white) lcolor(white)) 

. graph export "$figures/Feld-figure-5a-originalbw.tif", replace width(930) height(600)
(note: file C:\Users\brian\Dropbox (Personal)\Research\Argentina - Domestic workers reform\Paper\Cluster at MSA\JHR\Accepted\Replication do files/Figures/Feld-figure-5a-origina
> lbw.tif not found)
(file C:\Users\brian\Dropbox (Personal)\Research\Argentina - Domestic workers reform\Paper\Cluster at MSA\JHR\Accepted\Replication do files/Figures/Feld-figure-5a-originalbw.ti
> f written in TIFF format)

. 
. * Panel B: Wage per hour from main job
. 
. twoway (scatter linc_mjob_base08 year if domwk == 0, m(s) mc(purple) c(line) lpattern(dash) lcolor(purple)) (scatter linc_mjob_base08 year if domwk == 1, m(o) mc(maroon) c(li
> ne) lcolor(maroon)) ///
> (scatter coeflwagehr_mjob year if domwk == 0, yaxis(2) m(X) mc(blue)) (rcap ci_lowerlwagehr_mjob ci_upperlwagehr_mjob year if domwk == 0, yaxis(2) lcolor(blue)), ///
> legend(order (1 "Low-wage female workers" 2 "Female domestic workers" 3 "DiD coefficient" 4 "95% CI") span) xtitle("Year") xline(2012, lcolor(red)) xlabel(2010(1)2015) title(
> "Panel B: Wage per hour from main job") ///
> ytitle("DiD coefficient", axis(2)) ylabel(,angle(horizontal) axis(1)) ylabel(,angle(horizontal) axis(2)) ytitle("Log wage") graphregion(fcolor(white) lcolor(white)) 

. graph export "$figures/Feld-figure-5b-original.tif", replace width(930) height(600)
(note: file C:\Users\brian\Dropbox (Personal)\Research\Argentina - Domestic workers reform\Paper\Cluster at MSA\JHR\Accepted\Replication do files/Figures/Feld-figure-5b-origina
> l.tif not found)
(file C:\Users\brian\Dropbox (Personal)\Research\Argentina - Domestic workers reform\Paper\Cluster at MSA\JHR\Accepted\Replication do files/Figures/Feld-figure-5b-original.tif 
> written in TIFF format)

. 
. twoway (scatter linc_mjob_base08 year if domwk == 0, m(s) mc(black) c(line) lpattern(dash) lcolor(black)) (scatter linc_mjob_base08 year if domwk == 1, m(o) mc(black) c(line)
>  lcolor(black)) ///
> (scatter coeflwagehr_mjob year if domwk == 0, yaxis(2) m(X) mc(black)) (rcap ci_lowerlwagehr_mjob ci_upperlwagehr_mjob year if domwk == 0, yaxis(2) lcolor(black)), ///
> legend(order (1 "Low-wage female workers" 2 "Female domestic workers" 3 "DiD coefficient" 4 "95% CI") span) xtitle("Year") xline(2012, lcolor(black)) xlabel(2010(1)2015) titl
> e("Panel B: Wage per hour from main job") ///
> ytitle("DiD coefficient", axis(2)) ylabel(,angle(horizontal) axis(1)) ylabel(,angle(horizontal) axis(2)) ytitle("Log wage") graphregion(fcolor(white) lcolor(white)) 

. graph export "$figures/Feld-figure-5b-originalbw.tif", replace width(930) height(600)
(note: file C:\Users\brian\Dropbox (Personal)\Research\Argentina - Domestic workers reform\Paper\Cluster at MSA\JHR\Accepted\Replication do files/Figures/Feld-figure-5b-origina
> lbw.tif not found)
(file C:\Users\brian\Dropbox (Personal)\Research\Argentina - Domestic workers reform\Paper\Cluster at MSA\JHR\Accepted\Replication do files/Figures/Feld-figure-5b-originalbw.ti
> f written in TIFF format)

. 
. 
. * Panel C: Income per month from main job
. 
. twoway (scatter linc_mjob_base08 year if domwk == 0, m(s) mc(purple) c(line) lpattern(dash) lcolor(purple)) (scatter linc_mjob_base08 year if domwk == 1, m(o) mc(maroon) c(li
> ne) lcolor(maroon)) ///
> (scatter coeflinc_mjob year if domwk == 0, yaxis(2) m(X) mc(blue)) (rcap ci_lowerlinc_mjob ci_upperlinc_mjob year if domwk == 0, yaxis(2) lcolor(blue)), ///
> legend(order (1 "Low-wage female workers" 2 "Female domestic workers" 3 "DiD coefficient" 4 "95% CI") span) xtitle("Year") xline(2012, lcolor(red)) xlabel(2010(1)2015) title(
> "Panel C: Income per month from main job") ///
> ytitle("DiD coefficient", axis(2)) ylabel(,angle(horizontal) axis(1)) ylabel(,angle(horizontal) axis(2)) ytitle("Log income") graphregion(fcolor(white) lcolor(white)) 

. graph export "$figures/Feld-figure-5c-original.tif", replace width(930) height(600)
(note: file C:\Users\brian\Dropbox (Personal)\Research\Argentina - Domestic workers reform\Paper\Cluster at MSA\JHR\Accepted\Replication do files/Figures/Feld-figure-5c-origina
> l.tif not found)
(file C:\Users\brian\Dropbox (Personal)\Research\Argentina - Domestic workers reform\Paper\Cluster at MSA\JHR\Accepted\Replication do files/Figures/Feld-figure-5c-original.tif 
> written in TIFF format)

. 
. twoway (scatter linc_mjob_base08 year if domwk == 0, m(s) mc(black) c(line) lpattern(dash) lcolor(black)) (scatter linc_mjob_base08 year if domwk == 1, m(o) mc(black) c(line)
>  lcolor(black)) ///
> (scatter coeflinc_mjob year if domwk == 0, yaxis(2) m(X) mc(black)) (rcap ci_lowerlinc_mjob ci_upperlinc_mjob year if domwk == 0, yaxis(2) lcolor(black)), ///
> legend(order (1 "Low-wage female workers" 2 "Female domestic workers" 3 "DiD coefficient" 4 "95% CI") span) xtitle("Year") xline(2012, lcolor(black)) xlabel(2010(1)2015) titl
> e("Panel C: Income per month from main job") ///
> ytitle("DiD coefficient", axis(2)) ylabel(,angle(horizontal) axis(1)) ylabel(,angle(horizontal) axis(2)) ytitle("Log income") graphregion(fcolor(white) lcolor(white)) 

. graph export "$figures/Feld-figure-5c-originalbw.tif", replace width(930) height(600)
(note: file C:\Users\brian\Dropbox (Personal)\Research\Argentina - Domestic workers reform\Paper\Cluster at MSA\JHR\Accepted\Replication do files/Figures/Feld-figure-5c-origina
> lbw.tif not found)
(file C:\Users\brian\Dropbox (Personal)\Research\Argentina - Domestic workers reform\Paper\Cluster at MSA\JHR\Accepted\Replication do files/Figures/Feld-figure-5c-originalbw.ti
> f written in TIFF format)

. 
. 
. restore

. ********************************************************************************
. ********************************************************************************
. ********************************************************************************
. ********************************************************************************
. 
. ** Figure A1.1: Impact of domestic worker reform on wage distribution
. 
. preserve

. 
. keep if sample == 1
(115,782 observations deleted)

. 
. 
. * Generate wage bins. The first bin goes from 0 to 1.25 as in Cengiz et al. (2019), then bins are of ARS 0.25
. 
. gen bin = 1 if wagehr_mjob_base08 > 0 & wagehr_mjob_base08 < 1.25
(54,357 missing values generated)

. gen binwage = 0

. 
. local i = 2

. 
. forvalues w = 1.25(0.25)30 {
  2.     
.         local ub = `w' + 0.25
  3.         
.         replace bin = `i' if wagehr_mjob_base08 >= `w' & wagehr_mjob_base08 < `ub'
  4.         replace binwage = `w' if wagehr_mjob_base08 >= `w' & wagehr_mjob_base08 < `ub'  
  5.         
.         local i = `i' + 1
  6. }
(497 real changes made)
(497 real changes made)
(624 real changes made)
(624 real changes made)
(933 real changes made)
(933 real changes made)
(1,040 real changes made)
(1,040 real changes made)
(1,293 real changes made)
(1,293 real changes made)
(1,398 real changes made)
(1,398 real changes made)
(1,435 real changes made)
(1,435 real changes made)
(1,561 real changes made)
(1,561 real changes made)
(1,409 real changes made)
(1,409 real changes made)
(1,600 real changes made)
(1,600 real changes made)
(1,723 real changes made)
(1,723 real changes made)
(1,666 real changes made)
(1,666 real changes made)
(1,596 real changes made)
(1,596 real changes made)
(1,585 real changes made)
(1,585 real changes made)
(1,523 real changes made)
(1,523 real changes made)
(1,402 real changes made)
(1,402 real changes made)
(1,862 real changes made)
(1,862 real changes made)
(1,748 real changes made)
(1,748 real changes made)
(1,484 real changes made)
(1,484 real changes made)
(1,288 real changes made)
(1,288 real changes made)
(1,732 real changes made)
(1,732 real changes made)
(1,352 real changes made)
(1,352 real changes made)
(1,317 real changes made)
(1,317 real changes made)
(1,447 real changes made)
(1,447 real changes made)
(1,231 real changes made)
(1,231 real changes made)
(1,391 real changes made)
(1,391 real changes made)
(1,196 real changes made)
(1,196 real changes made)
(1,050 real changes made)
(1,050 real changes made)
(1,380 real changes made)
(1,380 real changes made)
(723 real changes made)
(723 real changes made)
(1,049 real changes made)
(1,049 real changes made)
(796 real changes made)
(796 real changes made)
(852 real changes made)
(852 real changes made)
(821 real changes made)
(821 real changes made)
(652 real changes made)
(652 real changes made)
(749 real changes made)
(749 real changes made)
(435 real changes made)
(435 real changes made)
(914 real changes made)
(914 real changes made)
(334 real changes made)
(334 real changes made)
(427 real changes made)
(427 real changes made)
(619 real changes made)
(619 real changes made)
(229 real changes made)
(229 real changes made)
(503 real changes made)
(503 real changes made)
(318 real changes made)
(318 real changes made)
(244 real changes made)
(244 real changes made)
(408 real changes made)
(408 real changes made)
(212 real changes made)
(212 real changes made)
(174 real changes made)
(174 real changes made)
(306 real changes made)
(306 real changes made)
(255 real changes made)
(255 real changes made)
(172 real changes made)
(172 real changes made)
(293 real changes made)
(293 real changes made)
(104 real changes made)
(104 real changes made)
(154 real changes made)
(154 real changes made)
(163 real changes made)
(163 real changes made)
(175 real changes made)
(175 real changes made)
(108 real changes made)
(108 real changes made)
(70 real changes made)
(70 real changes made)
(204 real changes made)
(204 real changes made)
(124 real changes made)
(124 real changes made)
(76 real changes made)
(76 real changes made)
(130 real changes made)
(130 real changes made)
(94 real changes made)
(94 real changes made)
(57 real changes made)
(57 real changes made)
(66 real changes made)
(66 real changes made)
(66 real changes made)
(66 real changes made)
(103 real changes made)
(103 real changes made)
(69 real changes made)
(69 real changes made)
(35 real changes made)
(35 real changes made)
(38 real changes made)
(38 real changes made)
(73 real changes made)
(73 real changes made)
(78 real changes made)
(78 real changes made)
(42 real changes made)
(42 real changes made)
(36 real changes made)
(36 real changes made)
(56 real changes made)
(56 real changes made)
(33 real changes made)
(33 real changes made)
(60 real changes made)
(60 real changes made)
(24 real changes made)
(24 real changes made)
(40 real changes made)
(40 real changes made)
(41 real changes made)
(41 real changes made)
(42 real changes made)
(42 real changes made)
(14 real changes made)
(14 real changes made)
(19 real changes made)
(19 real changes made)
(21 real changes made)
(21 real changes made)
(17 real changes made)
(17 real changes made)
(42 real changes made)
(42 real changes made)
(22 real changes made)
(22 real changes made)
(10 real changes made)
(10 real changes made)
(14 real changes made)
(14 real changes made)
(34 real changes made)
(34 real changes made)
(35 real changes made)
(35 real changes made)
(7 real changes made)
(7 real changes made)
(22 real changes made)
(22 real changes made)
(16 real changes made)
(16 real changes made)
(11 real changes made)
(11 real changes made)
(6 real changes made)
(6 real changes made)
(29 real changes made)
(29 real changes made)
(8 real changes made)
(8 real changes made)
(8 real changes made)
(8 real changes made)
(5 real changes made)
(5 real changes made)
(12 real changes made)
(12 real changes made)
(14 real changes made)
(14 real changes made)
(14 real changes made)
(14 real changes made)
(11 real changes made)
(11 real changes made)
(10 real changes made)
(10 real changes made)
(3 real changes made)
(3 real changes made)
(5 real changes made)
(5 real changes made)
(6 real changes made)
(6 real changes made)
(23 real changes made)
(23 real changes made)
(4 real changes made)
(4 real changes made)
(5 real changes made)
(5 real changes made)
(9 real changes made)
(9 real changes made)
(3 real changes made)
(3 real changes made)
(8 real changes made)
(8 real changes made)
(2 real changes made)
(2 real changes made)
(6 real changes made)
(6 real changes made)

. 
. replace bin = 117 if wagehr_mjob_base08 > 30 & !missing(wagehr_mjob_base08)
(273 real changes made)

. 
. 
. /* Include minimum wage data for domestic workers and non-domestic workers. This data was obtained from www.infoleg.gob.ar by searching foreach
> the decrees that set the minimum wages over time and deflated using Pricestat's CPI */
. 
. gen minwage = .
(54,963 missing values generated)

. replace minwage = 7.85 if time == tq(2010q1) & domwk == 1
(1,583 real changes made)

. replace minwage = 7.30 if time == tq(2010q2) & domwk == 1
(1,688 real changes made)

. replace minwage = 6.83 if time == tq(2010q3) & domwk == 1
(1,666 real changes made)

. replace minwage = 7.52 if time == tq(2010q4) & domwk == 1
(1,562 real changes made)

. replace minwage = 7.66 if time == tq(2011q1) & domwk == 1
(1,459 real changes made)

. replace minwage = 7.19 if time == tq(2011q2) & domwk == 1
(1,643 real changes made)

. replace minwage = 6.76 if time == tq(2011q3) & domwk == 1
(1,666 real changes made)

. replace minwage = 7.55 if time == tq(2011q4) & domwk == 1
(1,579 real changes made)

. replace minwage = 7.68 if time == tq(2012q1) & domwk == 1
(1,464 real changes made)

. replace minwage = 7.14 if time == tq(2012q2) & domwk == 1
(1,647 real changes made)

. replace minwage = 6.68 if time == tq(2012q3) & domwk == 1
(1,685 real changes made)

. replace minwage = 7.47 if time == tq(2012q4) & domwk == 1
(1,532 real changes made)

. replace minwage = 7.76 if time == tq(2013q1) & domwk == 1
(1,440 real changes made)

. replace minwage = 7.50 if time == tq(2013q2) & domwk == 1
(1,582 real changes made)

. replace minwage = 7.60 if time == tq(2013q3) & domwk == 1
(1,543 real changes made)

. replace minwage = 8.35 if time == tq(2013q4) & domwk == 1
(1,598 real changes made)

. replace minwage = 7.31 if time == tq(2014q1) & domwk == 1
(1,533 real changes made)

. replace minwage = 6.77 if time == tq(2014q2) & domwk == 1
(1,683 real changes made)

. replace minwage = 6.78 if time == tq(2014q3) & domwk == 1
(1,772 real changes made)

. replace minwage = 7.16 if time == tq(2014q4) & domwk == 1
(1,751 real changes made)

. replace minwage = 7.46 if time == tq(2015q1) & domwk == 1
(1,643 real changes made)

. replace minwage = 7.05 if time == tq(2015q2) & domwk == 1
(1,621 real changes made)

. 
. replace minwage = 5.73 if time == tq(2010q1) & domwk == 0
(859 real changes made)

. replace minwage = 5.33 if time == tq(2010q2) & domwk == 0
(878 real changes made)

. replace minwage = 5.52 if time == tq(2010q3) & domwk == 0
(911 real changes made)

. replace minwage = 5.53 if time == tq(2010q4) & domwk == 0
(964 real changes made)

. replace minwage = 5.58 if time == tq(2011q1) & domwk == 0
(828 real changes made)

. replace minwage = 5.24 if time == tq(2011q2) & domwk == 0
(873 real changes made)

. replace minwage = 5.33 if time == tq(2011q3) & domwk == 0
(898 real changes made)

. replace minwage = 5.90 if time == tq(2011q4) & domwk == 0
(925 real changes made)

. replace minwage = 5.59 if time == tq(2012q1) & domwk == 0
(800 real changes made)

. replace minwage = 5.20 if time == tq(2012q2) & domwk == 0
(878 real changes made)

. replace minwage = 5.12 if time == tq(2012q3) & domwk == 0
(880 real changes made)

. replace minwage = 5.42 if time == tq(2012q4) & domwk == 0
(888 real changes made)

. replace minwage = 5.52 if time == tq(2013q1) & domwk == 0
(842 real changes made)

. replace minwage = 5.46 if time == tq(2013q2) & domwk == 0
(903 real changes made)

. replace minwage = 5.59 if time == tq(2013q3) & domwk == 0
(875 real changes made)

. replace minwage = 5.51 if time == tq(2013q4) & domwk == 0
(898 real changes made)

. replace minwage = 5.26 if time == tq(2014q1) & domwk == 0
(829 real changes made)

. replace minwage = 4.88 if time == tq(2014q2) & domwk == 0
(978 real changes made)

. replace minwage = 4.91 if time == tq(2014q3) & domwk == 0
(949 real changes made)

. replace minwage = 5.25 if time == tq(2014q4) & domwk == 0
(982 real changes made)

. replace minwage = 5.33 if time == tq(2015q1) & domwk == 0
(871 real changes made)

. replace minwage = 5.04 if time == tq(2015q2) & domwk == 0
(914 real changes made)

. 
. * Generate wage differences
. 
. gen wagedif = binwage - minwage

. 
. 
. * Collapse the data
. 
. collapse (count) pid (firstnm) binwage (mean) minwage wagedif, by(year domwk bin)

. 
. bysort year domwk: egen nworkers = total(pid)

. 
. gen sharebin = pid / nworkers

. 
. 
. gen grm6 = wagedif >= -6 & wagedif < -5

. gen grm5 = wagedif >= -5 & wagedif < -4

. gen grm4 = wagedif >= -4 & wagedif < -3

. gen grm3 = wagedif >= -3 & wagedif < -2

. gen grm2 = wagedif >= -2 & wagedif < -1

. gen grm1 = wagedif >= -1 & wagedif < 0

. gen gr0 = wagedif >= 0 & wagedif < 1

. gen gr1 = wagedif >= 1 & wagedif < 2

. gen gr2 = wagedif >= 2 & wagedif < 3

. gen gr3 = wagedif >= 3 & wagedif < 4

. gen gr4 = wagedif >= 4 & wagedif < 5

. gen gr5 = wagedif >= 5 & wagedif < 6

. gen gr6 = wagedif >= 6 & wagedif < 7

. gen gr7 = wagedif >= 7 & wagedif < 8

. gen gr8 = wagedif >= 8 & wagedif < 9

. 
. forvalues i = 1/6 {
  2.     
.         local j = `i' - 1
  3.         
.     gen grm`i'_after_domwk = 0
  4.         replace grm`i'_after_domwk = 1 if grm`i' == 1 & year >= 2013 & domwk == 1
  5.         label var grm`i'_after_domwk "-$`i'"
  6.         
. }
(11 real changes made)
(14 real changes made)
(11 real changes made)
(12 real changes made)
(10 real changes made)
(15 real changes made)

. 
. forvalues i = 0/8 {
  2.     
.         local j = `i' + 1
  3.     
.     gen gr`i'_after_domwk = 0
  4.         replace gr`i'_after_domwk = 1 if gr`i' == 1 & year >= 2013 & domwk == 1
  5.         label var gr`i'_after_domwk "$`i'"
  6.                 
. }
(12 real changes made)
(14 real changes made)
(10 real changes made)
(12 real changes made)
(13 real changes made)
(11 real changes made)
(10 real changes made)
(11 real changes made)
(15 real changes made)

. 
. 
. forvalues i = 2010/2015 {
  2.     
.         gen year`i' = year == `i'
  3.         
. }

. 
. tab bin, gen(bin)

        bin |      Freq.     Percent        Cum.
------------+-----------------------------------
          1 |         12        1.02        1.02
          2 |         12        1.02        2.04
          3 |         12        1.02        3.05
          4 |         12        1.02        4.07
          5 |         12        1.02        5.09
          6 |         12        1.02        6.11
          7 |         12        1.02        7.12
          8 |         12        1.02        8.14
          9 |         12        1.02        9.16
         10 |         12        1.02       10.18
         11 |         12        1.02       11.20
         12 |         12        1.02       12.21
         13 |         12        1.02       13.23
         14 |         12        1.02       14.25
         15 |         12        1.02       15.27
         16 |         12        1.02       16.28
         17 |         12        1.02       17.30
         18 |         12        1.02       18.32
         19 |         12        1.02       19.34
         20 |         12        1.02       20.36
         21 |         12        1.02       21.37
         22 |         12        1.02       22.39
         23 |         12        1.02       23.41
         24 |         12        1.02       24.43
         25 |         12        1.02       25.45
         26 |         12        1.02       26.46
         27 |         12        1.02       27.48
         28 |         12        1.02       28.50
         29 |         12        1.02       29.52
         30 |         12        1.02       30.53
         31 |         12        1.02       31.55
         32 |         12        1.02       32.57
         33 |         12        1.02       33.59
         34 |         12        1.02       34.61
         35 |         12        1.02       35.62
         36 |         12        1.02       36.64
         37 |         12        1.02       37.66
         38 |         12        1.02       38.68
         39 |         12        1.02       39.69
         40 |         12        1.02       40.71
         41 |         12        1.02       41.73
         42 |         12        1.02       42.75
         43 |         11        0.93       43.68
         44 |         12        1.02       44.70
         45 |         12        1.02       45.72
         46 |         12        1.02       46.73
         47 |         12        1.02       47.75
         48 |         12        1.02       48.77
         49 |         12        1.02       49.79
         50 |         12        1.02       50.81
         51 |         12        1.02       51.82
         52 |         12        1.02       52.84
         53 |         12        1.02       53.86
         54 |         11        0.93       54.79
         55 |         12        1.02       55.81
         56 |         11        0.93       56.74
         57 |         12        1.02       57.76
         58 |         12        1.02       58.78
         59 |         12        1.02       59.80
         60 |         12        1.02       60.81
         61 |         11        0.93       61.75
         62 |         11        0.93       62.68
         63 |         12        1.02       63.70
         64 |         12        1.02       64.72
         65 |         10        0.85       65.56
         66 |         10        0.85       66.41
         67 |         12        1.02       67.43
         68 |         11        0.93       68.36
         69 |         11        0.93       69.30
         70 |          9        0.76       70.06
         71 |         11        0.93       70.99
         72 |         12        1.02       72.01
         73 |         12        1.02       73.03
         74 |         11        0.93       73.96
         75 |          8        0.68       74.64
         76 |         12        1.02       75.66
         77 |         11        0.93       76.59
         78 |         10        0.85       77.44
         79 |         11        0.93       78.37
         80 |         11        0.93       79.30
         81 |         11        0.93       80.24
         82 |         10        0.85       81.09
         83 |          6        0.51       81.59
         84 |          8        0.68       82.27
         85 |          7        0.59       82.87
         86 |          9        0.76       83.63
         87 |         11        0.93       84.56
         88 |         10        0.85       85.41
         89 |          7        0.59       86.01
         90 |          9        0.76       86.77
         91 |         10        0.85       87.62
         92 |          9        0.76       88.38
         93 |          4        0.34       88.72
         94 |          7        0.59       89.31
         95 |          7        0.59       89.91
         96 |          6        0.51       90.42
         97 |          5        0.42       90.84
         98 |          9        0.76       91.60
         99 |          6        0.51       92.11
        100 |          7        0.59       92.71
        101 |          2        0.17       92.88
        102 |          6        0.51       93.38
        103 |          8        0.68       94.06
        104 |          6        0.51       94.57
        105 |          5        0.42       95.00
        106 |          5        0.42       95.42
        107 |          3        0.25       95.67
        108 |          4        0.34       96.01
        109 |          4        0.34       96.35
        110 |          9        0.76       97.12
        111 |          3        0.25       97.37
        112 |          4        0.34       97.71
        113 |          5        0.42       98.13
        114 |          3        0.25       98.39
        115 |          5        0.42       98.81
        116 |          2        0.17       98.98
        117 |         12        1.02      100.00
------------+-----------------------------------
      Total |      1,179      100.00

. 
. forvalues i = 1/117 {
  2.     
.         gen bin`i'_2010 = bin`i'*year2010
  3.         gen bin`i'_2011 = bin`i'*year2011
  4.         gen bin`i'_2012 = bin`i'*year2012
  5.         gen bin`i'_2013 = bin`i'*year2013
  6.         gen bin`i'_2014 = bin`i'*year2014
  7.         gen bin`i'_2015 = bin`i'*year2015
  8.         gen bin`i'_domwk = bin`i'*domwk
  9. 
. }

. 
. reghdfe sharebin grm6_after_domwk grm5_after_domwk grm4_after_domwk grm3_after_domwk grm2_after_domwk grm1_after_domwk gr0_after_domwk-gr8_after_domwk, absorb(domwk#bin bin#y
> ear domwk#year) vce(unadjusted)
(dropped 129 singleton observations)
(MWFE estimator converged in 5 iterations)

HDFE Linear regression                            Number of obs   =      1,050
Absorbing 3 HDFE groups                           F(  15,    403) =       2.94
                                                  Prob > F        =     0.0002
                                                  R-squared       =     0.9802
                                                  Adj R-squared   =     0.9484
                                                  Within R-sq.    =     0.0986
                                                  Root MSE        =     0.0027

----------------------------------------------------------------------------------
        sharebin |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
-----------------+----------------------------------------------------------------
grm6_after_domwk |  -.0043237   .0013675    -3.16   0.002    -.0070122   -.0016353
grm5_after_domwk |  -.0056429   .0015893    -3.55   0.000    -.0087672   -.0025187
grm4_after_domwk |  -.0012794   .0014848    -0.86   0.389    -.0041984    .0016395
grm3_after_domwk |  -.0006137    .001523    -0.40   0.687    -.0036078    .0023804
grm2_after_domwk |   .0031853   .0014294     2.23   0.026     .0003752    .0059954
grm1_after_domwk |   .0037324   .0015697     2.38   0.018     .0006466    .0068181
 gr0_after_domwk |  -.0000439   .0015286    -0.03   0.977    -.0030491    .0029612
 gr1_after_domwk |   .0026827   .0014279     1.88   0.061    -.0001244    .0054898
 gr2_after_domwk |   .0029844   .0016211     1.84   0.066    -.0002024    .0061713
 gr3_after_domwk |   .0005246   .0015014     0.35   0.727    -.0024269    .0034762
 gr4_after_domwk |   .0004355   .0014639     0.30   0.766    -.0024423    .0033133
 gr5_after_domwk |   .0008258    .001545     0.53   0.593    -.0022116    .0038631
 gr6_after_domwk |   .0011422   .0016019     0.71   0.476    -.0020069    .0042913
 gr7_after_domwk |    .000239   .0015246     0.16   0.876    -.0027582    .0032362
 gr8_after_domwk |   .0005227   .0014297     0.37   0.715    -.0022879    .0033333
           _cons |    .011286     .00015    75.27   0.000     .0109913    .0115808
----------------------------------------------------------------------------------

Absorbed degrees of freedom:
------------------------------------------------------+
  Absorbed FE | Categories  - Redundant  = Num. Coefs |
--------------+---------------------------------------|
    domwk#bin |       202           0         202     |
     bin#year |       525         101         424     |
   domwk#year |        12           6           6    ?|
------------------------------------------------------+
? = number of redundant parameters may be higher

. 
. coefplot, keep(*_after_domwk) yline(0) vert title("Share of workers") xtitle("Wage bins in ARS relative to MW") graphregion(fcolor(white) lcolor(white)) ///
> ylabel(,nogrid angle(horizontal)) ytitle("Difference between the actual and" "counterfactual employment share") name(bin_num)

. 
. coefplot, keep(*_after_domwk) yline(0) vert title("Share of workers") xtitle("Wage bins in ARS relative to MW") graphregion(fcolor(white) lcolor(white)) ///
> ylabel(,nogrid angle(horizontal)) ytitle("Difference between the actual and" "counterfactual employment share") scheme(s2mono) name(bin_num_bw)

. 
. reghdfe pid grm6_after_domwk grm5_after_domwk grm4_after_domwk grm3_after_domwk grm2_after_domwk grm1_after_domwk gr0_after_domwk-gr8_after_domwk, absorb(domwk#bin bin#year d
> omwk#year) vce(unadjusted)
(dropped 129 singleton observations)
(MWFE estimator converged in 5 iterations)

HDFE Linear regression                            Number of obs   =      1,050
Absorbing 3 HDFE groups                           F(  15,    403) =       6.11
                                                  Prob > F        =     0.0000
                                                  R-squared       =     0.9711
                                                  Adj R-squared   =     0.9248
                                                  Within R-sq.    =     0.1852
                                                  Root MSE        =    17.6379

----------------------------------------------------------------------------------
             pid |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
-----------------+----------------------------------------------------------------
grm6_after_domwk |  -45.51058   8.940038    -5.09   0.000    -63.08551   -27.93564
grm5_after_domwk |  -63.93234   10.38953    -6.15   0.000    -84.35678    -43.5079
grm4_after_domwk |  -30.26017   9.706647    -3.12   0.002    -49.34216   -11.17819
grm3_after_domwk |  -26.52717   9.956605    -2.66   0.008    -46.10054   -6.953799
grm2_after_domwk |   4.413881   9.344602     0.47   0.637    -13.95637    22.78414
grm1_after_domwk |   8.576455   10.26134     0.84   0.404    -11.59598    28.74889
 gr0_after_domwk |    10.6208   9.993229     1.06   0.289    -9.024574    30.26616
 gr1_after_domwk |   18.32494   9.334797     1.96   0.050    -.0260413    36.67592
 gr2_after_domwk |   18.73739   10.59743     1.77   0.078    -2.095746    39.57054
 gr3_after_domwk |   12.08099   9.815137     1.23   0.219    -7.214268    31.37626
 gr4_after_domwk |   6.023151   9.569926     0.63   0.529    -12.79006    24.83636
 gr5_after_domwk |   6.769655   10.10037     0.67   0.503    -13.08633    26.62564
 gr6_after_domwk |   14.27195   10.47213     1.36   0.174    -6.314864    34.85877
 gr7_after_domwk |   4.565108   9.966937     0.46   0.647    -15.02857    24.15879
 gr8_after_domwk |   2.895121   9.346353     0.31   0.757    -15.47857    21.26882
           _cons |   52.72599   .9802692    53.79   0.000     50.79891    54.65307
----------------------------------------------------------------------------------

Absorbed degrees of freedom:
------------------------------------------------------+
  Absorbed FE | Categories  - Redundant  = Num. Coefs |
--------------+---------------------------------------|
    domwk#bin |       202           0         202     |
     bin#year |       525         101         424     |
   domwk#year |        12           6           6    ?|
------------------------------------------------------+
? = number of redundant parameters may be higher

. 
. coefplot, keep(*_after_domwk) yline(0) vert title("Number of workers") xtitle("Wage bins in ARS relative to MW") graphregion(fcolor(white) lcolor(white)) ///
> ylabel(,nogrid angle(horizontal)) ytitle("Difference between the actual and" "counterfactual employment count") name(bin_share)

. 
. coefplot, keep(*_after_domwk) yline(0) vert title("Number of workers") xtitle("Wage bins in ARS relative to MW") graphregion(fcolor(white) lcolor(white)) ///
> ylabel(,nogrid angle(horizontal)) ytitle("Difference between the actual and" "counterfactual employment count") scheme(s2mono) name(bin_share_bw)

. 
. graph combine bin_num bin_share, col(1) graphregion(fcolor(white) lcolor(white))

. graph export "$figures/Feld-figure-a1_1-original.tif", replace width(1200) height(900)
(note: file C:\Users\brian\Dropbox (Personal)\Research\Argentina - Domestic workers reform\Paper\Cluster at MSA\JHR\Accepted\Replication do files/Figures/Feld-figure-a1_1-origi
> nal.tif not found)
(file C:\Users\brian\Dropbox (Personal)\Research\Argentina - Domestic workers reform\Paper\Cluster at MSA\JHR\Accepted\Replication do files/Figures/Feld-figure-a1_1-original.ti
> f written in TIFF format)

. 
. graph combine bin_num_bw bin_share_bw, col(1) graphregion(fcolor(white) lcolor(white)) scheme(s2mono)

. graph export "$figures/Feld-figure-a1_1-originalbw.tif", replace width(1200) height(900)
(note: file C:\Users\brian\Dropbox (Personal)\Research\Argentina - Domestic workers reform\Paper\Cluster at MSA\JHR\Accepted\Replication do files/Figures/Feld-figure-a1_1-origi
> nalbw.tif not found)
(file C:\Users\brian\Dropbox (Personal)\Research\Argentina - Domestic workers reform\Paper\Cluster at MSA\JHR\Accepted\Replication do files/Figures/Feld-figure-a1_1-originalbw.
> tif written in TIFF format)

. 
. graph drop _all

. 
. restore

. 
. ********************************************************************************
. ********************************************************************************
. ********************************************************************************
. ********************************************************************************
. 
. ** Figure OA5.1: Share of workers by occupation
. 
. ** Number of domestic workers and non-domestic workers over time
. 
. gen hospitwk = (round(occupation/100) == 533 & domwk == 0)

. gen touristwk = (round(occupation/100) == 543 & domwk == 0)

. gen cleanwk = (round(occupation/100) == 563 & domwk == 0)

. gen carewk = (round(occupation/100) == 573 & domwk == 0)

. gen othwk = (round(occupation/100) == 583 & domwk == 0)

. 
. 
. * Collapse the data at the quarter level
. 
. collapse (mean) share_domwk = domwk share_hospit = hospitwk share_tourist = touristwk share_clean = cleanwk share_care = carewk share_othwk = othwk (sum) number_domwk = domwk
>  number_hospit = hospitwk number_tourist = touristwk number_clean = cleanwk number_care = carewk number_othwk = othwk, by(time)

. 
. format time %tqCCYY

. 
. ** Figure OA5.1: Share of workers by occupation
. 
. twoway line share_domwk share_hospit share_tourist share_clean share_care share_othwk time, lpattern(solid shortdash longdash dash_dot vshortdash dash_3dot) ///
> legend(order(1 "Domestic workers" 2 "Hospitality workers" 3 "Tourism workers" 4 "Cleaning workers" 5 "Caregivers" 6 "Other service workers") ///
> row(2) span symxsize(8)) xtitle(Year) ytitle(Share of workforce) xline(212, lcolor(red)) xlabel(200(4)220) graphregion(fcolor(white) lcolor(white))

. graph export "$figures/Feld-figure-oa5_1-original.tif", replace width(930) height(700)
(note: file C:\Users\brian\Dropbox (Personal)\Research\Argentina - Domestic workers reform\Paper\Cluster at MSA\JHR\Accepted\Replication do files/Figures/Feld-figure-oa5_1-orig
> inal.tif not found)
(file C:\Users\brian\Dropbox (Personal)\Research\Argentina - Domestic workers reform\Paper\Cluster at MSA\JHR\Accepted\Replication do files/Figures/Feld-figure-oa5_1-original.t
> if written in TIFF format)

. 
. twoway line share_domwk share_hospit share_tourist share_clean share_care share_othwk time, lpattern(solid shortdash longdash dash_dot vshortdash dash_3dot) ///
> lcolor(black black black black black black) legend(order(1 "Domestic workers" 2 "Hospitality workers" 3 "Tourism workers" 4 "Cleaning workers" 5 "Caregivers" 6 "Other service
>  workers") ///
> row(2) span symxsize(8)) xtitle(Year) ytitle(Share of workforce) xline(212, lcolor(black)) xlabel(200(4)220) graphregion(fcolor(white) lcolor(white))

. graph export "$figures/Feld-figure-oa5_1-originalbw.tif", replace width(930) height(700)
(note: file C:\Users\brian\Dropbox (Personal)\Research\Argentina - Domestic workers reform\Paper\Cluster at MSA\JHR\Accepted\Replication do files/Figures/Feld-figure-oa5_1-orig
> inalbw.tif not found)
(file C:\Users\brian\Dropbox (Personal)\Research\Argentina - Domestic workers reform\Paper\Cluster at MSA\JHR\Accepted\Replication do files/Figures/Feld-figure-oa5_1-originalbw
> .tif written in TIFF format)

. 
. 
. ** Figure OA5.2: Number of workers by occupation
. 
. twoway line number_domwk number_hospit number_tourist number_clean number_care number_othwk time, lpattern(solid shortdash longdash dash_dot vshortdash dash_3dot) ///
> legend(order(1 "Domestic workers" 2 "Hospitality workers" 3 "Tourism workers" 4 "Cleaning workers" 5 "Caregivers" 6 "Other service workers") ///
> row(2) span symxsize(8)) xtitle(Year) ytitle(Number of workers) xline(212, lcolor(red)) xlabel(200(4)220) graphregion(fcolor(white) lcolor(white))

. graph export "$figures/Feld-figure-oa5_2-original.tif", replace width(930) height(700)
(note: file C:\Users\brian\Dropbox (Personal)\Research\Argentina - Domestic workers reform\Paper\Cluster at MSA\JHR\Accepted\Replication do files/Figures/Feld-figure-oa5_2-orig
> inal.tif not found)
(file C:\Users\brian\Dropbox (Personal)\Research\Argentina - Domestic workers reform\Paper\Cluster at MSA\JHR\Accepted\Replication do files/Figures/Feld-figure-oa5_2-original.t
> if written in TIFF format)

. 
. twoway line number_domwk number_hospit number_tourist number_clean number_care number_othwk time, lpattern(solid shortdash longdash dash_dot vshortdash dash_3dot) ///
> lcolor(black black black black black black) legend(order(1 "Domestic workers" 2 "Hospitality workers" 3 "Tourism workers" 4 "Cleaning workers" 5 "Caregivers" 6 "Other service
>  workers") ///
> row(2) span symxsize(8)) xtitle(Year) ytitle(Number of workers) xline(212, lcolor(black)) xlabel(200(4)220) graphregion(fcolor(white) lcolor(white))

. graph export "$figures/Feld-figure-oa5_2-originalbw.tif", replace width(930) height(700)
(note: file C:\Users\brian\Dropbox (Personal)\Research\Argentina - Domestic workers reform\Paper\Cluster at MSA\JHR\Accepted\Replication do files/Figures/Feld-figure-oa5_2-orig
> inalbw.tif not found)
(file C:\Users\brian\Dropbox (Personal)\Research\Argentina - Domestic workers reform\Paper\Cluster at MSA\JHR\Accepted\Replication do files/Figures/Feld-figure-oa5_2-originalbw
> .tif written in TIFF format)

. 
. exit

end of do-file

. do "$dir/(2) Table 1.do"

. ********************************************************************************
. *************************** Do File (2): Table 1 *******************************
. ********************************************************************************
. 
. clear

. set more off

. 
. use "$data/EPH_1015_format.dta", clear

. 
. destring occupation occupation_unemp occup_all, replace
occupation: all characters numeric; replaced as long
(759813 missing values generated)
occupation_unemp: all characters numeric; replaced as long
(1246493 missing values generated)
occup_all: all characters numeric; replaced as long
(731803 missing values generated)

. 
. *** Keep only observations that have all controls used
. 
. keep if (occupation !=. & underemp != . & cont_pens !=. & domwk_all !=. & linc_mjob_base08 !=. & lwagehr_mjob_base08 !=. & linc_total_base08 != . & lhours_mjob !=. & age !=. 
> & hhsize !=. & tenure !=. & msa !=. & educyr !=. ///
> & attsch_ever !=. & native !=. & lit !=. & gender !=.) | (occupation_unemp != . & age !=. & hhsize !=. & msa !=. & educyr !=. & attsch_ever !=. & native !=. & lit !=. & gende
> r !=.)
(1,088,326 observations deleted)

. 
. ********************************************************************************
. ********************************************************************************
. 
. *** Locals for controls
. 
. 
. local occup occupation

. local base_controls "msa year"

. local controls "age age2 hhsize lit native attsch_ever educyr educyr2 i.marstat i.dec_pcfaminc"

. 
. ********************************************************************************
. ********************************************************************************
. ********************************************************************************
. 
. ** Create indicators for level of education
. 
. gen primary = educlv>=2

. label var primary "Complete primary school (share)"

. 
. gen secondary = educlv>=4

. label var secondary "Complete secondary school (share)"

. 
. gen tertiary = educlv==6 | educlv==8

. label var tertiary "Complete higher education (share)"

. 
. ** Create indicators for internal and foreign migrant
. 
. gen migrint = (native==1 & migrant==1)

. label var migrint "Share internal migrant"

. 
. gen migrfor = (native==0 & migrant==1)

. label var migrfor "Share foreign migrant"

. 
. ** Create married indicator
. 
. gen married = marstat == 2

. label var married "Share married"

. 
. 
. ********************************************************************************
. ********************************************************************************
. ********************************************************************************
. 
. * Run regression for pension contribution to restrict the sample to use
. 
. qui reghdfe cont_pens domwk_all treat_dwall `controls' if ${ctrl_group} == 1 & unemployed == 0, absorb(`base_controls' `occup') vce(cluster msa)

. gen sample_reg = 1 if e(sample)
(131,215 missing values generated)

. 
. * Create the summary statistics table
. 
. * Domestic workers
. 
. estpost sum age migrint migrfor married hhsize lit attsch_ever primary secondary tertiary educyr hours_mjob inc_mjob_base08 wagehr_mjob_base08 tenure cont_pens cont_health he
> alth_ins ///
> if treat == 0 & domwk == 1 & sample_reg == 1

             |  e(count)   e(sum_w)    e(mean)     e(Var)      e(sd)     e(min)     e(max)     e(sum) 
-------------+----------------------------------------------------------------------------------------
         age |     19174      19174   40.49953    173.352   13.16632         10         86     776538 
     migrint |     19174      19174   .1853552   .1510065   .3885956          0          1       3554 
     migrfor |     19174      19174   .0766663   .0707923   .2660682          0          1       1470 
     married |     19174      19174   .4460207   .2470991   .4970907          0          1       8552 
      hhsize |     19174      19174   4.321633   5.585223   2.363308          1         19      82863 
         lit |     19174      19174   .9927506   .0071972   .0848364          0          1      19035 
 attsch_ever |     19174      19174   .9931678   .0067858   .0823762          0          1      19043 
     primary |     19174      19174    .902107   .0883146   .2971776          0          1      17297 
   secondary |     19174      19174   .3053614   .2121269   .4605723          0          1       5855 
    tertiary |     19174      19174   .0191405   .0187751   .1370223          0          1        367 
      educyr |     19174      19174   8.907427   9.990334   3.160749          0         21     170791 
  hours_mjob |     19174      19174   24.65792   257.7105   16.05336          1         84     472791 
inc_mjob_~08 |     19174      19174   469.5577   109438.9   330.8154   17.06092   7108.718    9003299 
wagehr_mj~08 |     19174      19174   5.888901    19.6687   4.434941   .2135736   115.5167   112913.8 
      tenure |     19174      19174   49.24611   4846.096   69.61391          0        648     944245 
   cont_pens |     19174      19174   .1563576   .1319168   .3632035          0          1       2998 
 cont_health |     19174      19174   .1516637   .1286685    .358704          0          1       2908 
  health_ins |     19174      19174   .4246897   .2443411   .4943087          0          1       8143 

. estimates store Domestic_pre

. 
. ** Female Service workers
. 
. estpost sum age migrint migrfor married hhsize lit attsch_ever primary secondary tertiary educyr hours_mjob inc_mjob_base08 wagehr_mjob_base08 tenure cont_pens cont_health he
> alth_ins ///
> if treat == 0 & domwk == 0 & ${ctrl_group} == 1 & sample_reg == 1

             |  e(count)   e(sum_w)    e(mean)     e(Var)      e(sd)     e(min)     e(max)     e(sum) 
-------------+----------------------------------------------------------------------------------------
         age |     10582      10582   38.76488   164.1541   12.81227         12         88     410210 
     migrint |     10582      10582   .1886222   .1530583   .3912267          0          1       1996 
     migrfor |     10582      10582   .0452655   .0432207   .2078958          0          1        479 
     married |     10582      10582   .4696655   .2491034   .4991026          0          1       4970 
      hhsize |     10582      10582   4.362786   4.988211    2.23343          1         18      46167 
         lit |     10582      10582   .9966925   .0032969   .0574184          0          1      10547 
 attsch_ever |     10582      10582    .996409   .0035784   .0598201          0          1      10544 
     primary |     10582      10582   .9524665   .0452784   .2127872          0          1      10079 
   secondary |     10582      10582   .4379134   .2461685   .4961537          0          1       4634 
    tertiary |     10582      10582   .0460215   .0439077   .2095417          0          1        487 
      educyr |     10582      10582   9.983651   9.637102   3.104368          0         19     105647 
  hours_mjob |     10582      10582   34.97307   204.1869    14.2894          1         84     370085 
inc_mjob_~08 |     10582      10582   1095.854   504358.2   710.1818   15.28918   8027.155   1.16e+07 
wagehr_mj~08 |     10582      10582   8.386786      143.5   11.97915   .0796311   1093.724   88748.97 
      tenure |     10582      10582    38.9468   421.1584   20.52214          2         60     412135 
   cont_pens |     10582      10582   .6099036   .2379437   .4877947          0          1       6454 
 cont_health |     10582      10582   .6217161   .2352074   .4849819          0          1       6579 
  health_ins |     10582      10582   .7207522   .2012875   .4486507          0          1       7627 

. estimates store Female_Service_pre

. 
. estpost ttest age migrint migrfor married hhsize lit attsch_ever primary secondary tertiary educyr hours_mjob inc_mjob_base08 wagehr_mjob_base08 tenure cont_pens cont_health 
> health_ins ///
> if treat == 0 & ${ctrl_group} == 1 & sample_reg == 1, by(domwk) unequal

             |      e(b)   e(count)      e(se)       e(t)    e(df_t)     e(p_l)       e(p)     e(p_u)     e(N_1)    e(mu_1)     e(N_2)    e(mu_2) 
-------------+------------------------------------------------------------------------------------------------------------------------------------
         age | -1.734647      29756   .1566958  -11.07016   22323.91   1.04e-28   2.08e-28          1      10582   38.76488      19174   40.49953 
     migrint |   .003267      29756   .0047265   .6912163   21691.53   .7552815    .489437   .2447185      10582   .1886222      19174   .1853552 
     migrfor | -.0314008      29756   .0027886  -11.26029   26435.53   1.20e-29   2.40e-29          1      10582   .0452655      19174   .0766663 
     married |  .0236448      29756   .0060355   3.917611   21741.39   .9999551   .0000897   .0000449      10582   .4696655      19174   .4460207 
      hhsize |  .0411524      29756   .0276166   1.490131   22877.34   .9318983   .1362035   .0681017      10582   4.362786      19174   4.321633 
         lit |  .0039419      29756   .0008288   4.756118   28558.59    .999999   1.98e-06   9.92e-07      10582   .9966925      19174   .9927506 
 attsch_ever |  .0032412      29756   .0008319   3.896058   27621.54    .999951    .000098    .000049      10582    .996409      19174   .9931678 
     primary |  .0503594      29756   .0029807   16.89499   27826.92          1   1.02e-63   5.09e-64      10582   .9524665      19174    .902107 
   secondary |   .132552      29756   .0058589   22.62421   20481.75          1   5.9e-112   2.9e-112      10582   .4379134      19174   .3053614 
    tertiary |   .026881      29756   .0022646   11.87003   15682.34          1   2.33e-32   1.17e-32      10582   .0460215      19174   .0191405 
      educyr |  1.076225      29756   .0378384   28.44268   22150.41          1   8.3e-175   4.1e-175      10582   9.983651      19174   8.907427 
  hours_mjob |  10.31515      29756   .1809318   57.01125   24022.97          1          0          0      10582   34.97307      19174   24.65792 
inc_mjob_~08 |   626.296      29756   7.305447      85.73   13162.79          1          0          0      10582   1095.854      19174   469.5577 
wagehr_mj~08 |  2.497886      29756   .1207748   20.68217    12203.8          1   1.99e-93   9.94e-94      10582   8.386786      19174   5.888901 
      tenure | -10.29932      29756   .5408721  -19.04206   24582.24   1.45e-80   2.90e-80          1      10582    38.9468      19174   49.24611 
   cont_pens |   .453546      29756    .005419   83.69535   17159.97          1          0          0      10582   .6099036      19174   .1563576 
 cont_health |  .4700524      29756   .0053794   87.38046   17075.51          1          0          0      10582   .6217161      19174   .1516637 
  health_ins |  .2960625      29756    .005636   52.53016   23649.46          1          0          0      10582   .7207522      19174   .4246897 

. estimates store Female_Service_test

. 
. esttab Domestic_pre Female_Service_pre Female_Service_test using "$tables/Table 1", replace csv mtitle("Domestic Workers" "Low-wage service workers" "Difference") ///
> cell("mean(label(Mean) pattern(1 1 0) fmt(2)) b(star fmt(3) pattern(0 0 1))") label nonum f collabels(none)
(output written to C:\Users\brian\Dropbox (Personal)\Research\Argentina - Domestic workers reform\Paper\Cluster at MSA\JHR\Accepted\Replication do files/Tables/Table 1.csv)

. 
end of do-file

. do "$dir/(3) Table 2.do"

. ********************************************************************************
. *************************** Do File (3): Table 2 *******************************
. ********************************************************************************
. 
. clear

. matrix drop _all

. set more off

. 
. use "$data/EPH_1015_format.dta", clear

. 
. destring occupation occupation_unemp occup_all, replace
occupation: all characters numeric; replaced as long
(759813 missing values generated)
occupation_unemp: all characters numeric; replaced as long
(1246493 missing values generated)
occup_all: all characters numeric; replaced as long
(731803 missing values generated)

. 
. *** Keep only observations that have all controls used
. 
. keep if (occupation !=. & underemp != . & cont_pens !=. & domwk_all !=. & linc_mjob_base08 !=. & lwagehr_mjob_base08 !=. & linc_total_base08 != . & lhours_mjob !=. & age !=. 
> & hhsize !=. & tenure !=. & msa !=. & educyr !=. ///
> & attsch_ever !=. & native !=. & lit !=. & gender !=.) | (occupation_unemp != . & age !=. & hhsize !=. & msa !=. & educyr !=. & attsch_ever !=. & native !=. & lit !=. & gende
> r !=.)
(1,088,326 observations deleted)

. 
. ********************************************************************************
. ********************************************************************************
. 
. *** Locals for controls
. 
. 
. local occup occupation

. local base_controls "msa year"

. local controls "age age2 hhsize lit native attsch_ever educyr educyr2 i.marstat i.dec_pcfaminc"

. 
. ********************************************************************************
. ********************************************************************************
. ********************************************************************************
. 
. ** Create indicators for level of education
. 
. gen primary = educlv>=2

. label var primary "Share with complete primary school"

. 
. gen secondary = educlv>=4

. label var secondary "Share with complete secondary school"

. 
. gen tertiary = educlv==6 | educlv==8

. label var tertiary "Share with complete higher education"

. 
. ** Create indicators for internal and foreign migrant
. 
. gen migrint = (native==1 & migrant==1)

. label var migrint "Share internal migrant"

. 
. gen migrfor = (native==0 & migrant==1)

. label var migrfor "Share foreign migrant"

. 
. ** Create indicator for different marital status
. 
. gen married = marstat == 2

. label var married "Share married"

. 
. gen divorced = marstat == 3

. label var divorced "Share divorced"

. 
. gen widow = marstat == 4

. label var widow "Share widow"

. 
. ********************************************************************************
. ********************************************************************************
. ********************************************************************************
. 
. * Run regression for pension contribution to restrict the sample to use
. 
. qui reghdfe cont_pens domwk_all treat_dwall `controls' if ${ctrl_group} == 1 & unemployed == 0, absorb(`base_controls' `occup') vce(cluster msa)

. gen sample_reg = 1 if e(sample)
(131,215 missing values generated)

. 
. 
. * First run all the regressions to get the p-values and obtain adjusted p-values
. 
. foreach var in age migrint migrfor hhsize married divorced widow lit attsch_ever primary secondary tertiary educyr {
  2. 
.         egen mean_`var' = mean(cond(sample_reg == 1 & ${ctrl_group} == 1 & treat == 0,`var',.))
  3.         egen sd_`var' = sd(cond(sample_reg == 1 & ${ctrl_group} == 1 & treat == 0,`var',.))
  4.         gen std_`var' = (`var' - mean_`var') / sd_`var'
  5. 
.         qui reghdfe std_`var' domwk treat_dw if empstat == 1 & sample_reg == 1 & ${ctrl_group} == 1, absorb(`base_controls' `occup') vce(cluster msa)
  6.         
.         capture matrix list uP_treat
  7.         
.         if _rc != 0 {
  8.             
.                 matrix define uP_treat = 2*ttail(e(N),abs(_b[treat_dw]/_se[treat_dw]))
  9.                 
.         }
 10.         
.         else {
 11.             
.                 matrix uP_treat = uP_treat, 2*ttail(e(N),abs(_b[treat_dw]/_se[treat_dw]))
 12.         }
 13.         
. }

. 
. *** Label the variables as they appear in the table
. 
. label var std_age "Age"

. label var std_migrint "Internal migrant"

. label var std_migrfor "Foreign migrant"

. label var std_hhsize "Household size"

. label var std_married "Married"

. label var std_divorced "Divorced"

. label var std_widow "Widow"

. label var std_lit "Literate"

. label var std_attsch_ever "Attended school"

. label var std_primary "Primary school"

. label var std_secondary "Secondary school"

. label var std_tertiary "Tertiary school"

. label var std_educyr "Years of education"

. 
. 
. * Generate the adjusted p-values and put them in a matrix that will be exported with the regression estimates
. 
. matrix uP_treat = uP_treat'

. svmat uP_treat, names(unad_p)

. 
. qqvalue unad_p1, method(hochberg) qvalue(hochbergP)

. 
. qui sum unad_p1

. mkmat unad_p1 hochbergP if _n <= r(N), mat(adjPval)

. matrix adjPval = adjPval[1..r(N),2]

. 
. ** Rerun all the regressions, including the adjusted p-values
. 
. local i = 1

. local app replace

. 
. foreach var in std_age std_migrint std_migrfor std_hhsize std_married std_divorced std_widow std_lit std_attsch_ever std_primary std_secondary std_tertiary std_educyr {
  2. 
.         local varlabel: variable label `var'
  3.         qui reghdfe `var' domwk treat_dw if empstat == 1 & sample_reg == 1 & ${ctrl_group} == 1, absorb(`base_controls' `occup') vce(cluster msa)
  4.         local qval = round(adjPval[`i',1], 0.001)
  5.         outreg2 using "$tables/Table_2", `app' excel keep(treat_dw) nocons nor2 dec(3) label ctitle(`varlabel') addstat(q-value, `qval') ///
>         addtext(Year Fixed Effects, Yes, Occupation Fixed Effects, Yes, Metropolitan Area Fixed Effects, Yes, Number of clusters, "`e(N_clust)'")
  6.         
.         local app append
  7.         local i = `i' + 1
  8. }
C:\Users\brian\Dropbox (Personal)\Research\Argentina - Domestic workers reform\Paper\Cluster at MSA\JHR\Accepted\Replication do files/Tables/Table_2.xml
dir : seeout
C:\Users\brian\Dropbox (Personal)\Research\Argentina - Domestic workers reform\Paper\Cluster at MSA\JHR\Accepted\Replication do files/Tables/Table_2.xml
dir : seeout
C:\Users\brian\Dropbox (Personal)\Research\Argentina - Domestic workers reform\Paper\Cluster at MSA\JHR\Accepted\Replication do files/Tables/Table_2.xml
dir : seeout
C:\Users\brian\Dropbox (Personal)\Research\Argentina - Domestic workers reform\Paper\Cluster at MSA\JHR\Accepted\Replication do files/Tables/Table_2.xml
dir : seeout
C:\Users\brian\Dropbox (Personal)\Research\Argentina - Domestic workers reform\Paper\Cluster at MSA\JHR\Accepted\Replication do files/Tables/Table_2.xml
dir : seeout
C:\Users\brian\Dropbox (Personal)\Research\Argentina - Domestic workers reform\Paper\Cluster at MSA\JHR\Accepted\Replication do files/Tables/Table_2.xml
dir : seeout
C:\Users\brian\Dropbox (Personal)\Research\Argentina - Domestic workers reform\Paper\Cluster at MSA\JHR\Accepted\Replication do files/Tables/Table_2.xml
dir : seeout
C:\Users\brian\Dropbox (Personal)\Research\Argentina - Domestic workers reform\Paper\Cluster at MSA\JHR\Accepted\Replication do files/Tables/Table_2.xml
dir : seeout
C:\Users\brian\Dropbox (Personal)\Research\Argentina - Domestic workers reform\Paper\Cluster at MSA\JHR\Accepted\Replication do files/Tables/Table_2.xml
dir : seeout
C:\Users\brian\Dropbox (Personal)\Research\Argentina - Domestic workers reform\Paper\Cluster at MSA\JHR\Accepted\Replication do files/Tables/Table_2.xml
dir : seeout
C:\Users\brian\Dropbox (Personal)\Research\Argentina - Domestic workers reform\Paper\Cluster at MSA\JHR\Accepted\Replication do files/Tables/Table_2.xml
dir : seeout
C:\Users\brian\Dropbox (Personal)\Research\Argentina - Domestic workers reform\Paper\Cluster at MSA\JHR\Accepted\Replication do files/Tables/Table_2.xml
dir : seeout
C:\Users\brian\Dropbox (Personal)\Research\Argentina - Domestic workers reform\Paper\Cluster at MSA\JHR\Accepted\Replication do files/Tables/Table_2.xml
dir : seeout

. 
end of do-file

. do "$dir/(4) Table 3.do"

. ********************************************************************************
. *************************** Do File (4): Table 3 *******************************
. ********************************************************************************
. 
. clear

. matrix drop _all

. set more off

. 
. use "$data/EPH_1015_format.dta", clear

. 
. destring occupation occupation_unemp occup_all, replace
occupation: all characters numeric; replaced as long
(759813 missing values generated)
occupation_unemp: all characters numeric; replaced as long
(1246493 missing values generated)
occup_all: all characters numeric; replaced as long
(731803 missing values generated)

. 
. *** Keep only observations that have all controls used
. 
. keep if (occupation !=. & underemp != . & cont_pens !=. & domwk_all !=. & linc_mjob_base08 !=. & lwagehr_mjob_base08 !=. & linc_total_base08 != . & lhours_mjob !=. & age !=. 
> & hhsize !=. & tenure !=. & msa !=. & educyr !=. ///
> & attsch_ever !=. & native !=. & lit !=. & gender !=.) | (occupation_unemp != . & age !=. & hhsize !=. & msa !=. & educyr !=. & attsch_ever !=. & native !=. & lit !=. & gende
> r !=.)
(1,088,326 observations deleted)

. 
. ********************************************************************************
. ********************************************************************************
. 
. *** Locals for controls
. 
. local occup occupation

. local base_controls "msa year"

. local controls "age age2 hhsize lit native attsch_ever educyr educyr2 i.marstat i.dec_pcfaminc"

. 
. 
. *** Label the variables as they appear in the table
. 
. label var cont_pens "Registered"

. label var unemployed "Unemployed"

. label var lhours_mjob "Hours of work per week on main job"

. label var underemp "Underemployment"

. label var linc_mjob_base08 "Income per month from main job"

. label var lwagehr_mjob_base08 "Wage per hour from main job"

. 
. ********************************************************************************
. ********************************************************************************
. ********************************************************************************
. 
. * First run all the regressions to get the p-values and obtain adjusted p-values
. 
. qui reghdfe cont_pens domwk_all treat_dwall `controls' if ${ctrl_group} == 1 & unemployed == 0, absorb(`base_controls' `occup') vce(cluster msa)

. gen sample_reg = 1 if e(sample)
(131,215 missing values generated)

. matrix define uPtreat = 2*ttail(e(N),abs(_b[treat_dwall]/_se[treat_dwall]))

. 
. qui reghdfe unemployed domwk_all treat_dwall `controls' if ${ctrl_group} == 1, absorb(`base_controls' occup_all) vce(cluster msa)

. matrix uPtreat = uPtreat,2*ttail(e(N),abs(_b[treat_dwall]/_se[treat_dwall]))

. 
. foreach var in lhours_mjob underemp linc_mjob_base08 lwagehr_mjob_base08 {
  2. 
.         qui reghdfe `var' domwk_all treat_dwall `controls' if sample_reg == 1, absorb(`base_controls' `occup') vce(cluster msa)
  3.         matrix uPtreat = uPtreat,2*ttail(e(N),abs(_b[treat_dwall]/_se[treat_dwall]))
  4.                 
. }

. 
. * Calculate adjusted p-values
. 
. matrix uPtreat = uPtreat'

. svmat uPtreat, names(unad_p)

. 
. qqvalue unad_p1, method(hochberg) qvalue(hochbergP_treat)

. 
. qui sum unad_p1

. mkmat unad_p1 hochbergP_treat if _n <= r(N), mat(adjPval)

. matrix adjPval = adjPval[1..r(N),2]

. 
. matrix colnames adjPval = hochberg_p

. matrix rownames adjPval = cont_pens unemployed lhours_mjob underemp linc_mjob_base08 lwagehr_mjob_base08

. 
. 
. ** Rerun all the regressions, including the adjusted p-values
. 
. local i = 1

. 
. * Formality - Contribution to pension system
. 
. local varlabel: variable label cont_pens

. qui reghdfe cont_pens domwk_all treat_dwall `controls' if sample_reg == 1, absorb(`base_controls' `occup') vce(cluster msa)

. sum cont_pens if domwk_all == 1 & treat == 0 & e(sample)

    Variable |        Obs        Mean    Std. Dev.       Min        Max
-------------+---------------------------------------------------------
   cont_pens |     19,174    .1563576    .3632035          0          1

. local meanvar = r(mean)

. local qval = round(adjPval[`i',1], 0.001)

. outreg2 using "$tables/Table_3", replace excel keep(treat_dwall) nocons dec(3) label ctitle(`varlabel') addstat(Mean dependent variable,`meanvar', q-value, `qval') ///
> addtext(Year Fixed Effects, Yes, Occupation Fixed Effects, Yes, Metropolitan Area Fixed Effects, Yes, Number of clusters, "`e(N_clust)'")
C:\Users\brian\Dropbox (Personal)\Research\Argentina - Domestic workers reform\Paper\Cluster at MSA\JHR\Accepted\Replication do files/Tables/Table_3.xml
dir : seeout

. local i = `i' + 1

. 
. * Unemployment
. 
. local varlabel: variable label unemployed

. qui reghdfe unemployed domwk_all treat_dwall `controls' if ${ctrl_group} == 1, absorb(`base_controls' occup_all) vce(cluster msa)

. sum unemployed if domwk_all == 1 & treat == 0 & e(sample)

    Variable |        Obs        Mean    Std. Dev.       Min        Max
-------------+---------------------------------------------------------
  unemployed |     20,997    .0868219    .2815806          0          1

. local meanvar = r(mean)

. local qval = round(adjPval[`i',1], 0.001)

. outreg2 using "$tables/Table_3", append excel keep(treat_dwall) nocons dec(3) label ctitle(`varlabel') addstat(Mean dependent variable,`meanvar', q-value, `qval') ///
> addtext(Year Fixed Effects, Yes, Occupation Fixed Effects, Yes, Metropolitan Area Fixed Effects, Yes, Number of clusters, "`e(N_clust)'")
C:\Users\brian\Dropbox (Personal)\Research\Argentina - Domestic workers reform\Paper\Cluster at MSA\JHR\Accepted\Replication do files/Tables/Table_3.xml
dir : seeout

. local i = `i' + 1

. 
. * Log hours of work per week
. 
. local varlabel: variable label lhours_mjob

. qui reghdfe lhours_mjob domwk_all treat_dwall `controls' if sample_reg == 1, absorb(`base_controls' `occup') vce(cluster msa)

. sum hours_mjob if domwk_all == 1 & treat == 0 & e(sample)

    Variable |        Obs        Mean    Std. Dev.       Min        Max
-------------+---------------------------------------------------------
  hours_mjob |     19,174    24.65792    16.05336          1         84

. local meanvar r(mean)

. local qval = round(adjPval[`i',1], 0.001)

. outreg2 using "$tables/Table_3", append excel keep(treat_dwall) nocons dec(3) label ctitle(`varlabel') addstat(Mean dependent variable,`meanvar', q-value, `qval') ///
> addtext(Year Fixed Effects, Yes, Occupation Fixed Effects, Yes, Metropolitan Area Fixed Effects, Yes, Number of clusters, "`e(N_clust)'")
C:\Users\brian\Dropbox (Personal)\Research\Argentina - Domestic workers reform\Paper\Cluster at MSA\JHR\Accepted\Replication do files/Tables/Table_3.xml
dir : seeout

. local i = `i' + 1

. 
. * Underemployment (working fewer hours than desired)
. 
. local varlabel: variable label underemp

. qui reghdfe underemp domwk_all treat_dwall `controls' if sample_reg == 1, absorb(`base_controls' `occup') vce(cluster msa)

. sum underemp if domwk_all == 1 & treat == 0 & e(sample)

    Variable |        Obs        Mean    Std. Dev.       Min        Max
-------------+---------------------------------------------------------
    underemp |     19,174    .1685094    .3743278          0          1

. local meanvar r(mean)

. local qval = round(adjPval[`i',1], 0.001)

. outreg2 using "$tables/Table_3", append excel keep(treat_dwall) nocons dec(3) label ctitle(`varlabel') addstat(Mean dependent variable,`meanvar', q-value, `qval') ///
> addtext(Year Fixed Effects, Yes, Occupation Fixed Effects, Yes, Metropolitan Area Fixed Effects, Yes, Number of clusters, "`e(N_clust)'")
C:\Users\brian\Dropbox (Personal)\Research\Argentina - Domestic workers reform\Paper\Cluster at MSA\JHR\Accepted\Replication do files/Tables/Table_3.xml
dir : seeout

. local i = `i' + 1

. 
. 
. * Earnings
. 
. foreach var in inc_mjob_base08 wagehr_mjob_base08 {
  2. 
.         local varlabel: variable label `var'
  3.         qui reghdfe l`var' domwk_all treat_dwall `controls' if sample_reg == 1, absorb(`base_controls' `occup') vce(cluster msa)
  4.         sum `var' if domwk_all == 1 & treat == 0 & e(sample)
  5.         local meanvar r(mean)
  6.         local qval = round(adjPval[`i',1], 0.001)
  7.         outreg2 using "$tables/Table_3", append excel keep(treat_dwall) nocons dec(3) label ctitle(`varlabel') addstat(Mean dependent variable,`meanvar', q-value, `qval') 
> ///
>         addtext(Year Fixed Effects, Yes, Occupation Fixed Effects, Yes, Metropolitan Area Fixed Effects, Yes, Number of clusters, "`e(N_clust)'")
  8.         local i = `i' + 1
  9.         
. }

    Variable |        Obs        Mean    Std. Dev.       Min        Max
-------------+---------------------------------------------------------
inc_mjob_~08 |     19,174    469.5577    330.8154   17.06092   7108.718
C:\Users\brian\Dropbox (Personal)\Research\Argentina - Domestic workers reform\Paper\Cluster at MSA\JHR\Accepted\Replication do files/Tables/Table_3.xml
dir : seeout

    Variable |        Obs        Mean    Std. Dev.       Min        Max
-------------+---------------------------------------------------------
wagehr_mj~08 |     19,174    5.888901    4.434941   .2135736   115.5167
C:\Users\brian\Dropbox (Personal)\Research\Argentina - Domestic workers reform\Paper\Cluster at MSA\JHR\Accepted\Replication do files/Tables/Table_3.xml
dir : seeout

. 
. exit

end of do-file

. do "$dir/(5) Table 4.do"

. ********************************************************************************
. *************************** Do File (5): Table 4 *******************************
. ********************************************************************************
. 
. clear

. matrix drop _all

. set more off

. 
. use "$data/EPH_1015_format.dta", clear

. 
. destring occupation occupation_unemp occup_all, replace
occupation: all characters numeric; replaced as long
(759813 missing values generated)
occupation_unemp: all characters numeric; replaced as long
(1246493 missing values generated)
occup_all: all characters numeric; replaced as long
(731803 missing values generated)

. 
. *** Keep only observations that have all controls used
. 
. keep if (occupation !=. & underemp != . & cont_pens !=. & domwk_all !=. & linc_mjob_base08 !=. & lwagehr_mjob_base08 !=. & linc_total_base08 != . & lhours_mjob !=. & age !=. 
> & hhsize !=. & tenure !=. & msa !=. & educyr !=. ///
> & attsch_ever !=. & native !=. & lit !=. & gender !=.) | (occupation_unemp != . & age !=. & hhsize !=. & msa !=. & educyr !=. & attsch_ever !=. & native !=. & lit !=. & gende
> r !=.)
(1,088,326 observations deleted)

. 
. ** Keeps only women to run the analysis using observations from only one household member
. keep if gender == 0
(15,433 observations deleted)

. 
. ********************************************************************************
. ********************************************************************************
. 
. *** Locals for controls
. 
. local occup occupation

. local base_controls "msa year"

. local controls "age age2 hhsize lit native attsch_ever educyr educyr2 i.marstat i.dec_pcfaminc"

. 
. *** Label the variables as they appear in the table
. 
. label var mean_active "Labor force participation"

. label var share_formal "Share registered"

. label var lhhd_hours_mjob "Hours of work per week"

. label var lhhd_labinc_base08 "Labor income per month"

. 
. ********************************************************************************
. ********************************************************************************
. ********************************************************************************
. 
. * Run regression for pension contribution to restrict the sample to use
. 
. qui reghdfe cont_pens domwk_all treat_dwall `controls' if ${ctrl_group} == 1 & unemployed == 0, absorb(`base_controls' `occup') vce(cluster msa)

. gen sample_reg = 1 if e(sample)
(115,782 missing values generated)

. 
. 
. ********************************************************************************
. ********************************************************************************
. 
. ** Households with spouse or children
. 
. sort time CODUSU nro_hogar pid

. 
. duplicates drop time CODUSU nro_hogar, force

Duplicates in terms of time CODUSU nro_hogar

(19,359 observations deleted)

. 
. 
. * First run all the regressions to get the p-values and obtain adjusted p-values
. 
. foreach var in mean_active share_formal lhhd_hours_mjob lhhd_labinc_base08 {
  2.         
.         qui reghdfe `var' hhd_domwk treat_hhddw if sample_reg == 1 & (haschild1625 == 1 | marstat == 2), absorb(`base_controls') vce(cluster msa)
  3. 
.         capture matrix list uP_treat
  4.         
.         if _rc != 0 {
  5.             
.                 matrix define uP_treat = 2*ttail(e(N),abs(_b[treat_hhddw]/_se[treat_hhddw]))
  6.                 
.         }
  7.         
.         else {
  8.             
.                 matrix uP_treat = uP_treat, 2*ttail(e(N),abs(_b[treat_hhddw]/_se[treat_hhddw]))
  9.         }
 10.         
. }

. 
. * Generate the adjusted p-values and put them in a matrix that will be exported with the regression estimates
. 
. matrix uP_treat = uP_treat'

. svmat uP_treat, names(unad_p)

. 
. qqvalue unad_p1, method(hochberg) qvalue(hochbergP)

. 
. qui sum unad_p1

. mkmat unad_p1 hochbergP if _n <= r(N), mat(adjPval)

. matrix adjPval = adjPval[1..r(N),2]

. 
. ** Rerun all the regressions, including the adjusted p-values
. 
. local i = 1

. 
. local varlabel: variable label mean_active

. qui reghdfe mean_active hhd_domwk treat_hhddw if sample_reg == 1 & (haschild1625 == 1 | marstat == 2), absorb(`base_controls') vce(cluster msa)

. sum mean_active if hhd_domwk == 1 & treat == 0 & e(sample)

    Variable |        Obs        Mean    Std. Dev.       Min        Max
-------------+---------------------------------------------------------
 mean_active |     12,760    .7667225     .230564          0          1

. local meanvar = r(mean)

. local qval = round(adjPval[`i',1], 0.001)

. outreg2 using "$tables/Table_4", replace excel keep(treat_hhddw) nocons dec(3) label ctitle(`varlabel') addstat(Mean dependent variable,`meanvar', q-value, `qval') ///
> addtext(Controls, No, Year Fixed Effects, Yes, Occupation Fixed Effects, No, MA Fixed Effects, Yes, Number of clusters, "`e(N_clust)'")
C:\Users\brian\Dropbox (Personal)\Research\Argentina - Domestic workers reform\Paper\Cluster at MSA\JHR\Accepted\Replication do files/Tables/Table_4.xml
dir : seeout

. 
. local i = `i' + 1

. 
. 
. local varlabel: variable label share_formal

. qui reghdfe share_formal hhd_domwk treat_hhddw if sample_reg == 1 & (haschild1625 == 1 | marstat == 2), absorb(`base_controls') vce(cluster msa)

. sum share_formal if hhd_domwk == 1 & treat == 0 & e(sample)

    Variable |        Obs        Mean    Std. Dev.       Min        Max
-------------+---------------------------------------------------------
share_formal |     12,760    .2744182    .3357983          0          1

. local meanvar = r(mean)

. local qval = round(adjPval[`i',1], 0.001)

. outreg2 using "$tables/Table_4", append excel keep(treat_hhddw) nocons dec(3) label ctitle(`varlabel') addstat(Mean dependent variable,`meanvar', q-value, `qval') ///
> addtext(Controls, No, Year Fixed Effects, Yes, Occupation Fixed Effects, No, MA Fixed Effects, Yes, Number of clusters, "`e(N_clust)'")
C:\Users\brian\Dropbox (Personal)\Research\Argentina - Domestic workers reform\Paper\Cluster at MSA\JHR\Accepted\Replication do files/Tables/Table_4.xml
dir : seeout

. 
. local i = `i' + 1

. 
. foreach var in hhd_hours_mjob hhd_labinc_base08 {
  2.         
.         local varlabel: variable label l`var'
  3.         qui reghdfe l`var' hhd_domwk treat_hhddw if sample_reg == 1 & (haschild1625 == 1 | marstat == 2), absorb(`base_controls') vce(cluster msa)
  4.         sum `var' if hhd_domwk == 1 & treat == 0 & e(sample)
  5.         local meanvar = r(mean)
  6.         local qval = round(adjPval[`i',1], 0.001)
  7.         outreg2 using "$tables/Table_4", append excel keep(treat_hhddw) nocons dec(3) label ctitle(`varlabel') addstat(Mean dependent variable,`meanvar', q-value, `qval') 
> ///
>         addtext(Controls, No, Year Fixed Effects, Yes, Occupation Fixed Effects, No, MA Fixed Effects, Yes, Number of clusters, "`e(N_clust)'")
  8.         
.         local i = `i' + 1
  9.         
. }

    Variable |        Obs        Mean    Std. Dev.       Min        Max
-------------+---------------------------------------------------------
hhd_hou~mjob |     12,760    73.64545    45.58487          2        434
C:\Users\brian\Dropbox (Personal)\Research\Argentina - Domestic workers reform\Paper\Cluster at MSA\JHR\Accepted\Replication do files/Tables/Table_4.xml
dir : seeout

    Variable |        Obs        Mean    Std. Dev.       Min        Max
-------------+---------------------------------------------------------
hhd_labin~08 |     12,760    1667.906    1439.554   21.32615   13540.93
C:\Users\brian\Dropbox (Personal)\Research\Argentina - Domestic workers reform\Paper\Cluster at MSA\JHR\Accepted\Replication do files/Tables/Table_4.xml
dir : seeout

. 
end of do-file

. do "$dir/(6) Tables 5 and 6.do"

. ********************************************************************************
. *********************** Do File (6): Tables 5 and 6 ****************************
. ********************************************************************************
. 
. clear

. matrix drop _all

. set more off

. 
. use "$data/EPH_1015_format.dta", clear

. 
. *** Keep only observations that have all controls used
. 
. keep if age !=. & msa !=. & hhsize !=. & educyr !=. & attsch_ever !=. & native !=. & lit !=. & gender !=. & marstat != . & dec_pcfaminc != .
(45,044 observations deleted)

. 
. *** Keep only spouses of domestic workers
. keep if sp_domwk != .
(1,149,753 observations deleted)

. 
. ********************************************************************************
. ********************************************************************************
. 
. *** Locals for controls
. 
. local base_controls "msa year occupation sp_occupation"

. 
. local controls "age age2 hhsize lit native attsch_ever educyr educyr2 i.dec_pcfaminc"

. 
. *** Label the variables as they appear in the table
. 
. label var active "Participation"

. label var cont_pens "Registered"

. label var hours_mjob "Hours of work per week"

. label var inc_mjob_base08 "Income per month"

. label var wagehr_mjob_base08 "Wage per hour"

. 
. ********************************************************************************
. ********************************************************************************
. ********************************************************************************
. 
. * First run all the regressions to get the p-values and obtain adjusted p-values
. 
. qui reghdfe active sp_domwk treat_spdw `controls' if sp_${ctrl_group} == 1, absorb(msa year sp_occupation) vce(cluster msa)

. matrix define uPtreat = 2*ttail(e(N),abs(_b[treat_spdw]/_se[treat_spdw]))

. 
. qui reghdfe cont_pens sp_domwk treat_spdw `controls' if empstat == 1 & lwagehr_mjob_base08 != . & cont_pens != . & linc_mjob_base08 != . & sp_${ctrl_group} == 1, absorb(`base
> _controls' `occup') vce(cluster msa)

. gen sample_reg = 1 if e(sample)
(66,221 missing values generated)

. matrix uPtreat = uPtreat,2*ttail(e(N),abs(_b[treat_spdw]/_se[treat_spdw]))

. 
. foreach var in lhours_mjob linc_mjob_base08 lwagehr_mjob_base08 {
  2. 
.         qui reghdfe `var' sp_domwk treat_spdw `controls' if sample_reg == 1, absorb(`base_controls' `occup') vce(cluster msa)
  3.         matrix uPtreat = uPtreat,2*ttail(e(N),abs(_b[treat_spdw]/_se[treat_spdw]))
  4.         
. }

. 
. * Generate the adjusted p-values and put them in a matrix that will be exported with the regression estimates
. 
. matrix uPtreat = uPtreat'

. svmat uPtreat, names(unad_p)

. 
. qqvalue unad_p1, method(hochberg) qvalue(hochbergP)

. 
. qui sum unad_p1

. mkmat unad_p1 hochbergP if _n <= r(N), mat(adjPval)

. matrix adjPval = adjPval[1..r(N),2]

. 
. ** Rerun all the regressions, including the adjusted p-values
. 
. local i = 1

. 
. ** Labor force participation
. 
. local varlabel: variable label active

. qui reghdfe active sp_domwk treat_spdw `controls' if sp_${ctrl_group} == 1, absorb(msa year sp_occupation) vce(cluster msa)

. sum active if sp_domwk == 1 & treat == 0 & e(sample)

    Variable |        Obs        Mean    Std. Dev.       Min        Max
-------------+---------------------------------------------------------
      active |      8,086    .8889439    .3142211          0          1

. local meanvar = r(mean)

. local qval = round(adjPval[`i',1], 0.001)

. outreg2 using "$tables/Table_5a", replace excel keep(treat_spdw) nocons dec(3) label ctitle(`varlabel') addstat(Mean dependent variable,`meanvar', q-value, `qval')
C:\Users\brian\Dropbox (Personal)\Research\Argentina - Domestic workers reform\Paper\Cluster at MSA\JHR\Accepted\Replication do files/Tables/Table_5a.xml
dir : seeout

. local i = `i' + 1

. 
. 
. ** Formality conditional on LF participation
. 
. local varlabel: variable label cont_pens

. qui reghdfe cont_pens sp_domwk treat_spdw `controls' if sample_reg == 1, absorb(`base_controls' `occup') vce(cluster msa)

. sum cont_pens if sp_domwk == 1 & treat == 0 & e(sample)

    Variable |        Obs        Mean    Std. Dev.       Min        Max
-------------+---------------------------------------------------------
   cont_pens |      4,306    .6288899    .4831579          0          1

. local meanvar = r(mean)

. local qval = round(adjPval[`i',1], 0.001)

. outreg2 using "$tables/Table_5a", append excel keep(treat_spdw) nocons dec(3) label ctitle(`varlabel') addstat(Mean dependent variable,`meanvar', q-value, `qval')
C:\Users\brian\Dropbox (Personal)\Research\Argentina - Domestic workers reform\Paper\Cluster at MSA\JHR\Accepted\Replication do files/Tables/Table_5a.xml
dir : seeout

. local i = `i' + 1

. 
. 
. foreach var in hours_mjob inc_mjob_base08 wagehr_mjob_base08 {
  2. 
.         local varlabel: variable label `var'
  3.         qui reghdfe l`var' sp_domwk treat_spdw `controls' if sample_reg == 1, absorb(`base_controls' `occup') vce(cluster msa)
  4.         sum `var' if sp_domwk == 1 & treat == 0 & e(sample)
  5.         local meanvar = r(mean)
  6.         local qval = round(adjPval[`i',1], 0.001)
  7.         outreg2 using "$tables/Table_5a", append excel keep(treat_spdw) nocons dec(3) label ctitle(`varlabel') addstat(Mean dependent variable,`meanvar', q-value, `qval')
  8.         local i = `i' + 1
  9. }

    Variable |        Obs        Mean    Std. Dev.       Min        Max
-------------+---------------------------------------------------------
  hours_mjob |      4,306    46.89944    14.41835          2         84
C:\Users\brian\Dropbox (Personal)\Research\Argentina - Domestic workers reform\Paper\Cluster at MSA\JHR\Accepted\Replication do files/Tables/Table_5a.xml
dir : seeout

    Variable |        Obs        Mean    Std. Dev.       Min        Max
-------------+---------------------------------------------------------
inc_mjob_~08 |      4,306    1540.614    917.2378   90.46507    8479.71
C:\Users\brian\Dropbox (Personal)\Research\Argentina - Domestic workers reform\Paper\Cluster at MSA\JHR\Accepted\Replication do files/Tables/Table_5a.xml
dir : seeout

    Variable |        Obs        Mean    Std. Dev.       Min        Max
-------------+---------------------------------------------------------
wagehr_mj~08 |      4,306     8.83156     7.03029    .445953   277.1147
C:\Users\brian\Dropbox (Personal)\Research\Argentina - Domestic workers reform\Paper\Cluster at MSA\JHR\Accepted\Replication do files/Tables/Table_5a.xml
dir : seeout

. 
. ********************************************************************************
. ********************************************************************************
. 
. matrix drop _all

. use "$data/EPH_1015_format.dta", clear

. 
. *** Keep only observations that have all controls used
. 
. keep if age !=. & msa !=. & hhsize !=. & native !=. & gender !=. & educyr != .
(0 observations deleted)

. 
. 
. *** Keep only children aged 16 to 25.
. 
. replace par_domwk = . if age > 25
(20,042 real changes made, 20,042 to missing)

. replace par_domwk = . if age < 16
(106,905 real changes made, 106,905 to missing)

. 
. *** Create variable for having completed primary school
. 
. gen primary = educlv >= 2

. label var primary "Primary school completed"

. 
. *** Create variable for having completed secondary school
. 
. gen secondary = educlv >= 4

. label var secondary "Secondary school completed"

. 
. *** Create variable for the years of education of the head of the household
. bysort CODUSU nro_hogar time: egen head_educyr = max(cond(relhh == 1, educyr,.))
(567 missing values generated)

. label var head_educyr "Years of education of the head of the household"

. 
. gen head_educyr2 = head_educyr^2
(567 missing values generated)

. 
. ** Treatment for children of domestic workers
. 
. gen treat_pardw=treat*par_domwk
(1,204,652 missing values generated)

. label var treat_pardw "Parent is DW x Reform"

. 
. keep if par_domwk != .
(1,204,652 observations deleted)

. keep if par_${ctrl_group} == 1
(38,545 observations deleted)

. 
. ********************************************************************************
. ********************************************************************************
. 
. *** Locals for controls
. 
. local base_controls "msa year occupation par_occupation"

. local controls "gender age age2 hhsize i.marstat i.dec_pcfaminc head_educyr head_educyr2 singlepar"

. 
. *** Label the variables as they appear in the table
. 
. label var active "Participation"

. label var cont_pens "Registered"

. label var hours_mjob "Hours of work per week"

. label var inc_mjob_base08 "Income per month"

. label var wagehr_mjob_base08 "Wage per hour"

. 
. ********************************************************************************
. ********************************************************************************
. ********************************************************************************
. 
. 
. 
. * First run all the regressions to get the p-values and obtain adjusted p-values
. 
. 
. *** Labor force participation
. 
. qui reghdfe active par_domwk treat_pardw `controls', absorb(msa year par_occupation) vce(cluster msa)

. matrix define uPtreat = 2*ttail(e(N),abs(_b[treat_pardw]/_se[treat_pardw]))

. 
. 
. *** Formality conditional on LF participation
. 
. qui reghdfe cont_pens par_domwk treat_pardw `controls' if lwagehr_mjob_base08 != . & cont_pens != . & linc_mjob_base08 != ., absorb(`base_controls') vce(cluster msa)

. gen sample_reg = 1 if e(sample)
(22,487 missing values generated)

. matrix uPtreat = uPtreat,2*ttail(e(N),abs(_b[treat_pardw]/_se[treat_pardw]))

. 
. 
. foreach var in lhours_mjob linc_mjob_base08 lwagehr_mjob_base08 {
  2. 
.         qui reghdfe `var' par_domwk treat_pardw `controls' if sample_reg == 1, absorb(`base_controls') vce(cluster msa)
  3.         matrix uPtreat = uPtreat,2*ttail(e(N),abs(_b[treat_pardw]/_se[treat_pardw]))
  4. 
. }

. 
. ********************************************************************************
. ********************************************************************************
. 
. *** Heterogeneity by gender
. 
. ** Women
. 
. *** Labor force participation
. 
. qui reghdfe active par_domwk treat_pardw `controls' if gender == 0, absorb(msa year par_occupation) vce(cluster msa)

. matrix uPtreat = uPtreat,2*ttail(e(N),abs(_b[treat_pardw]/_se[treat_pardw]))

. 
. *** Formality conditional on LF participation
. 
. qui reghdfe cont_pens par_domwk treat_pardw `controls' if sample_reg == 1 & gender == 0, absorb(`base_controls') vce(cluster msa)

. matrix uPtreat = uPtreat,2*ttail(e(N),abs(_b[treat_pardw]/_se[treat_pardw]))

. 
. 
. foreach var in hours_mjob inc_mjob_base08 wagehr_mjob_base08 {
  2. 
.         qui reghdfe l`var' par_domwk treat_pardw `controls' if sample_reg == 1 & gender == 0, absorb(`base_controls') vce(cluster msa)
  3.         matrix uPtreat = uPtreat,2*ttail(e(N),abs(_b[treat_pardw]/_se[treat_pardw]))
  4.         
. }

. 
. 
. ********************************************************************************
. 
. ** Men
. 
. *** Labor force participation
. 
. qui reghdfe active par_domwk treat_pardw `controls' if gender == 1, absorb(msa year par_occupation) vce(cluster msa)

. matrix uPtreat = uPtreat,2*ttail(e(N),abs(_b[treat_pardw]/_se[treat_pardw]))

. 
. *** Formality conditional on LF participation
. 
. qui reghdfe cont_pens par_domwk treat_pardw `controls' if sample_reg == 1 & gender == 1, absorb(`base_controls') vce(cluster msa)

. matrix uPtreat = uPtreat,2*ttail(e(N),abs(_b[treat_pardw]/_se[treat_pardw]))

. 
. 
. foreach var in hours_mjob inc_mjob_base08 wagehr_mjob_base08 {
  2. 
.         qui reghdfe l`var' par_domwk treat_pardw `controls' if sample_reg == 1 & gender == 1, absorb(`base_controls') vce(cluster msa)
  3.         matrix uPtreat = uPtreat,2*ttail(e(N),abs(_b[treat_pardw]/_se[treat_pardw]))
  4. 
. }

. 
. ********************************************************************************
. ********************************************************************************
. 
. * Generate the adjusted p-values and put them in a matrix that will be exported with the regression estimates
. 
. matrix uPtreat = uPtreat'

. svmat uPtreat, names(unad_p)

. 
. qqvalue unad_p1, method(hochberg) qvalue(hochbergP)

. 
. qui sum unad_p1

. mkmat unad_p1 hochbergP if _n <= r(N), mat(adjPval)

. matrix adjPval = adjPval[1..r(N),2]

. 
. ** Rerun all the regressions, including the adjusted p-values
. 
. local i = 1

. 
. 
. *** Labor force participation
. 
. local varlabel: variable label active

. qui reghdfe active par_domwk treat_pardw `controls', absorb(msa year par_occupation) vce(cluster msa)

. sum active if par_domwk == 1 & treat == 0 & e(sample)

    Variable |        Obs        Mean    Std. Dev.       Min        Max
-------------+---------------------------------------------------------
      active |     10,897    .4566394    .4981392          0          1

. local meanvar = r(mean)

. local qval = round(adjPval[`i',1], 0.001)

. outreg2 using "$tables/Table_5b", replace excel keep(treat_pardw) nocons dec(3) label ctitle(`varlabel') addstat(Mean dependent variable,`meanvar', q-value, `qval') addtext(C
> ontrols, Yes, Year Fixed Effects, Yes, Occupation Fixed Effects, No, Metropolitan Area Fixed Effects, Yes, Number of clusters, "`e(N_clust)'")
C:\Users\brian\Dropbox (Personal)\Research\Argentina - Domestic workers reform\Paper\Cluster at MSA\JHR\Accepted\Replication do files/Tables/Table_5b.xml
dir : seeout

. outreg2 using "$tables/Table_6a", replace excel keep(treat_pardw) nocons dec(3) label ctitle(`varlabel') addstat(Mean dependent variable,`meanvar', q-value, `qval')
C:\Users\brian\Dropbox (Personal)\Research\Argentina - Domestic workers reform\Paper\Cluster at MSA\JHR\Accepted\Replication do files/Tables/Table_6a.xml
dir : seeout

. local i = `i' + 1

. 
. 
. *** Formality conditional on LF participation
. 
. local varlabel: variable label cont_pens

. qui reghdfe cont_pens par_domwk treat_pardw `controls' if sample_reg == 1, absorb(`base_controls') vce(cluster msa)

. sum cont_pens if par_domwk == 1 & treat == 0 & e(sample)

    Variable |        Obs        Mean    Std. Dev.       Min        Max
-------------+---------------------------------------------------------
   cont_pens |      3,203    .2987824    .4577957          0          1

. local meanvar = r(mean)

. local qval = round(adjPval[`i',1], 0.001)

. outreg2 using "$tables/Table_5b", append excel keep(treat_pardw) nocons dec(3) label ctitle(`varlabel') addstat(Mean dependent variable,`meanvar', q-value, `qval') addtext(Co
> ntrols, Yes, Year Fixed Effects, Yes, Occupation Fixed Effects, Yes, Metropolitan Area Fixed Effects, Yes, Number of clusters, "`e(N_clust)'")
C:\Users\brian\Dropbox (Personal)\Research\Argentina - Domestic workers reform\Paper\Cluster at MSA\JHR\Accepted\Replication do files/Tables/Table_5b.xml
dir : seeout

. outreg2 using "$tables/Table_6a", append excel keep(treat_pardw) nocons dec(3) label ctitle(`varlabel') addstat(Mean dependent variable,`meanvar', q-value, `qval')
C:\Users\brian\Dropbox (Personal)\Research\Argentina - Domestic workers reform\Paper\Cluster at MSA\JHR\Accepted\Replication do files/Tables/Table_6a.xml
dir : seeout

. local i = `i' + 1

. 
. 
. foreach var in hours_mjob inc_mjob_base08 wagehr_mjob_base08 {
  2. 
.         local varlabel: variable label `var'
  3.         qui reghdfe l`var' par_domwk treat_pardw `controls' if sample_reg == 1, absorb(`base_controls') vce(cluster msa)
  4.         sum `var' if par_domwk == 1 & treat == 0 & e(sample)
  5.         local meanvar = r(mean)
  6.         local qval = round(adjPval[`i',1], 0.001)
  7.         outreg2 using "$tables/Table_5b", append excel keep(treat_pardw) nocons dec(3) label ctitle(`varlabel') addstat(Mean dependent variable,`meanvar', q-value, `qval')
>  addtext(Controls, Yes, Year Fixed Effects, Yes, Occupation Fixed Effects, Yes, Metropolitan Area Fixed Effects, Yes, Number of clusters, "`e(N_clust)'")
  8.         outreg2 using "$tables/Table_6a", append excel keep(treat_pardw) nocons dec(3) label ctitle(`varlabel') addstat(Mean dependent variable,`meanvar', q-value, `qval')
  9.         local i = `i' + 1
 10. }

    Variable |        Obs        Mean    Std. Dev.       Min        Max
-------------+---------------------------------------------------------
  hours_mjob |      3,203    36.76335    16.35239          1         84
C:\Users\brian\Dropbox (Personal)\Research\Argentina - Domestic workers reform\Paper\Cluster at MSA\JHR\Accepted\Replication do files/Tables/Table_5b.xml
dir : seeout
C:\Users\brian\Dropbox (Personal)\Research\Argentina - Domestic workers reform\Paper\Cluster at MSA\JHR\Accepted\Replication do files/Tables/Table_6a.xml
dir : seeout

    Variable |        Obs        Mean    Std. Dev.       Min        Max
-------------+---------------------------------------------------------
inc_mjob_~08 |      3,203       860.1    657.7439    17.0684   5681.265
C:\Users\brian\Dropbox (Personal)\Research\Argentina - Domestic workers reform\Paper\Cluster at MSA\JHR\Accepted\Replication do files/Tables/Table_5b.xml
dir : seeout
C:\Users\brian\Dropbox (Personal)\Research\Argentina - Domestic workers reform\Paper\Cluster at MSA\JHR\Accepted\Replication do files/Tables/Table_6a.xml
dir : seeout

    Variable |        Obs        Mean    Std. Dev.       Min        Max
-------------+---------------------------------------------------------
wagehr_mj~08 |      3,203    6.318696    6.003784   .2705365   181.8314
C:\Users\brian\Dropbox (Personal)\Research\Argentina - Domestic workers reform\Paper\Cluster at MSA\JHR\Accepted\Replication do files/Tables/Table_5b.xml
dir : seeout
C:\Users\brian\Dropbox (Personal)\Research\Argentina - Domestic workers reform\Paper\Cluster at MSA\JHR\Accepted\Replication do files/Tables/Table_6a.xml
dir : seeout

. 
. ********************************************************************************
. ********************************************************************************
. 
. *** Heterogeneity by gender
. 
. ** Women
. 
. 
. *** Labor force participation
. 
. local varlabel: variable label active

. qui reghdfe active par_domwk treat_pardw `controls' if gender == 0, absorb(msa year par_occupation) vce(cluster msa)

. sum active if par_domwk == 1 & treat == 0 & e(sample)

    Variable |        Obs        Mean    Std. Dev.       Min        Max
-------------+---------------------------------------------------------
      active |      5,372    .3471705    .4761148          0          1

. local meanvar = r(mean)

. local qval = round(adjPval[`i',1], 0.001)

. outreg2 using "$tables/Table_6b", replace excel keep(treat_pardw) nocons dec(3) label ctitle(`varlabel') addstat(Mean dependent variable,`meanvar', q-value, `qval')
C:\Users\brian\Dropbox (Personal)\Research\Argentina - Domestic workers reform\Paper\Cluster at MSA\JHR\Accepted\Replication do files/Tables/Table_6b.xml
dir : seeout

. local i = `i' + 1

. 
. *** Formality conditional on LF participation
. 
. local varlabel: variable label cont_pens

. qui reghdfe cont_pens par_domwk treat_pardw `controls' if sample_reg == 1 & gender == 0, absorb(`base_controls') vce(cluster msa)

. sum cont_pens if par_domwk == 1 & treat == 0 & e(sample)

    Variable |        Obs        Mean    Std. Dev.       Min        Max
-------------+---------------------------------------------------------
   cont_pens |      1,220    .2786885    .4485378          0          1

. local meanvar = r(mean)

. local qval = round(adjPval[`i',1], 0.001)

. outreg2 using "$tables/Table_6b", append excel keep(treat_pardw) nocons dec(3) label ctitle(`varlabel') addstat(Mean dependent variable,`meanvar', q-value, `qval')
C:\Users\brian\Dropbox (Personal)\Research\Argentina - Domestic workers reform\Paper\Cluster at MSA\JHR\Accepted\Replication do files/Tables/Table_6b.xml
dir : seeout

. local i = `i' + 1

. 
. 
. foreach var in hours_mjob inc_mjob_base08 wagehr_mjob_base08 {
  2. 
.         local varlabel: variable label `var'
  3.         qui reghdfe l`var' par_domwk treat_pardw `controls' if sample_reg == 1 & gender == 0, absorb(`base_controls') vce(cluster msa)
  4.         sum `var' if par_domwk == 1 & treat == 0 & e(sample)
  5.         local meanvar = r(mean)
  6.         local qval = round(adjPval[`i',1], 0.001)
  7.         outreg2 using "$tables/Table_6b", append excel keep(treat_pardw) nocons dec(3) label ctitle(`varlabel') addstat(Mean dependent variable,`meanvar', q-value, `qval')
  8.         local i = `i' + 1
  9. }

    Variable |        Obs        Mean    Std. Dev.       Min        Max
-------------+---------------------------------------------------------
  hours_mjob |      1,220    29.05164    15.76696          2         84
C:\Users\brian\Dropbox (Personal)\Research\Argentina - Domestic workers reform\Paper\Cluster at MSA\JHR\Accepted\Replication do files/Tables/Table_6b.xml
dir : seeout

    Variable |        Obs        Mean    Std. Dev.       Min        Max
-------------+---------------------------------------------------------
inc_mjob_~08 |      1,220    673.0379    570.9788    17.0684   4586.754
C:\Users\brian\Dropbox (Personal)\Research\Argentina - Domestic workers reform\Paper\Cluster at MSA\JHR\Accepted\Replication do files/Tables/Table_6b.xml
dir : seeout

    Variable |        Obs        Mean    Std. Dev.       Min        Max
-------------+---------------------------------------------------------
wagehr_mj~08 |      1,220    6.307267    5.247351   .2705365   76.88651
C:\Users\brian\Dropbox (Personal)\Research\Argentina - Domestic workers reform\Paper\Cluster at MSA\JHR\Accepted\Replication do files/Tables/Table_6b.xml
dir : seeout

. 
. 
. ********************************************************************************
. 
. 
. ** Men
. 
. *** Labor force participation
. 
. local varlabel: variable label active

. qui reghdfe active par_domwk treat_pardw `controls' if gender == 1, absorb(msa year par_occupation) vce(cluster msa)

. sum active if par_domwk == 1 & treat == 0 & e(sample)

    Variable |        Obs        Mean    Std. Dev.       Min        Max
-------------+---------------------------------------------------------
      active |      5,525    .5630769    .4960502          0          1

. local meanvar = r(mean)

. local qval = round(adjPval[`i',1], 0.001)

. outreg2 using "$tables/Table_6c", replace excel keep(treat_pardw) nocons dec(3) label ctitle(`varlabel') addstat(Mean dependent variable,`meanvar', q-value, `qval') addtext(C
> ontrols, Yes, Year Fixed Effects, Yes, Occupation Fixed Effects, No, Metropolitan Area Fixed Effects, Yes, Number of clusters, "`e(N_clust)'")
C:\Users\brian\Dropbox (Personal)\Research\Argentina - Domestic workers reform\Paper\Cluster at MSA\JHR\Accepted\Replication do files/Tables/Table_6c.xml
dir : seeout

. local i = `i' + 1

. 
. *** Formality conditional on LF participation
. 
. local varlabel: variable label cont_pens

. qui reghdfe cont_pens par_domwk treat_pardw `controls' if sample_reg == 1 & gender == 1, absorb(`base_controls') vce(cluster msa)

. sum cont_pens if par_domwk == 1 & treat == 0 & e(sample)

    Variable |        Obs        Mean    Std. Dev.       Min        Max
-------------+---------------------------------------------------------
   cont_pens |      1,975    .3108861    .4629735          0          1

. local meanvar = r(mean)

. local qval = round(adjPval[`i',1], 0.001)

. outreg2 using "$tables/Table_6c", append excel keep(treat_pardw) nocons dec(3) label ctitle(`varlabel') addstat(Mean dependent variable,`meanvar', q-value, `qval') addtext(Co
> ntrols, Yes, Year Fixed Effects, Yes, Occupation Fixed Effects, Yes, Metropolitan Area Fixed Effects, Yes, Number of clusters, "`e(N_clust)'")
C:\Users\brian\Dropbox (Personal)\Research\Argentina - Domestic workers reform\Paper\Cluster at MSA\JHR\Accepted\Replication do files/Tables/Table_6c.xml
dir : seeout

. local i = `i' + 1

. 
. 
. foreach var in hours_mjob inc_mjob_base08 wagehr_mjob_base08 {
  2. 
.         local varlabel: variable label `var'
  3.         qui reghdfe l`var' par_domwk treat_pardw `controls' if sample_reg == 1 & gender == 1, absorb(`base_controls') vce(cluster msa)
  4.         sum `var' if par_domwk == 1 & treat == 0 & e(sample)
  5.         local meanvar = r(mean)
  6.         local qval = round(adjPval[`i',1], 0.001)
  7.         outreg2 using "$tables/Table_6c", append excel keep(treat_pardw) nocons dec(3) label ctitle(`varlabel') addstat(Mean dependent variable,`meanvar', q-value, `qval')
>  addtext(Controls, Yes, Year Fixed Effects, Yes, Occupation Fixed Effects, Yes, Metropolitan Area Fixed Effects, Yes, Number of clusters, "`e(N_clust)'")
  8.         local i = `i' + 1
  9. }

    Variable |        Obs        Mean    Std. Dev.       Min        Max
-------------+---------------------------------------------------------
  hours_mjob |      1,975    41.53873    14.83405          1         84
C:\Users\brian\Dropbox (Personal)\Research\Argentina - Domestic workers reform\Paper\Cluster at MSA\JHR\Accepted\Replication do files/Tables/Table_6c.xml
dir : seeout

    Variable |        Obs        Mean    Std. Dev.       Min        Max
-------------+---------------------------------------------------------
inc_mjob_~08 |      1,975     974.217    680.0792   28.43487   5681.265
C:\Users\brian\Dropbox (Personal)\Research\Argentina - Domestic workers reform\Paper\Cluster at MSA\JHR\Accepted\Replication do files/Tables/Table_6c.xml
dir : seeout

    Variable |        Obs        Mean    Std. Dev.       Min        Max
-------------+---------------------------------------------------------
wagehr_mj~08 |      1,975    6.318438    6.433821   .2937329   181.8314
C:\Users\brian\Dropbox (Personal)\Research\Argentina - Domestic workers reform\Paper\Cluster at MSA\JHR\Accepted\Replication do files/Tables/Table_6c.xml
dir : seeout

. 
end of do-file

. do "$dir/(7) Table A1_1.do"

. ********************************************************************************
. ************************* Do File (7): Table A1.1*******************************
. ********************************************************************************
. 
. clear

. set more off

. 
. use "$data/EPH_1015_format.dta", clear

. 
. destring occupation occupation_unemp occup_all, replace
occupation: all characters numeric; replaced as long
(759813 missing values generated)
occupation_unemp: all characters numeric; replaced as long
(1246493 missing values generated)
occup_all: all characters numeric; replaced as long
(731803 missing values generated)

. 
. *** Keep only observations that have all controls used
. 
. keep if (occupation !=. & underemp != . & cont_pens !=. & domwk_all !=. & linc_mjob_base08 !=. & lwagehr_mjob_base08 !=. & linc_total_base08 != . & hours_mjob !=. & age !=. &
>  hhsize !=. & tenure !=. & msa !=. & educyr !=. ///
> & attsch_ever !=. & native !=. & lit !=. & gender !=.) | (occupation_unemp != . & age !=. & hhsize !=. & msa !=. & educyr !=. & attsch_ever !=. & native !=. & lit !=. & gende
> r !=.)
(1,088,326 observations deleted)

. 
. ********************************************************************************
. ********************************************************************************
. 
. * Generate lags of pension contribution and domestic worker status
. 
. sort CODUSU nro_hogar pid quarter year

. 
. gen lcont_pens = cont_pens[_n-1] if CODUSU == CODUSU[_n-1] & nro_hogar == nro_hogar[_n-1] & pid == pid[_n-1] & quarter == quarter[_n-1]
(150,391 missing values generated)

. label var lcont_pens "Made social security contribution last year"

. 
. gen ldomwk = domwk[_n-1] if CODUSU == CODUSU[_n-1] & nro_hogar == nro_hogar[_n-1] & pid == pid[_n-1] & quarter == quarter[_n-1]
(150,391 missing values generated)

. label var ldomwk "Was domestic worker last year"

. 
. //gen l${ctrl_group} = ${ctrl_group}[_n-1] if CODUSU == CODUSU[_n-1] & nro_hogar == nro_hogar[_n-1] & pid == pid[_n-1] & quarter == quarter[_n-1]
. //label var l${ctrl_group} "Was worker in ${ctrl_group} last year"
. 
. * Matrix for non-domestic workers
. 
. /*qui sum cont_pens if lcont_pens == 0 & domwk == 0 & ${ctrl_group} == 1 & gender == 0 & year == 2010
> matrix define meanunreg = r(mean)
> 
> qui sum cont_pens if lcont_pens == 1 & domwk == 0 & ${ctrl_group} == 1 & gender == 0 & year == 2010
> matrix define meanreg = r(mean)
> 
> qui sum cont_pens if lcont_pens != . & domwk == 0 & ${ctrl_group} == 1 & gender == 0 & year == 2010
> matrix define meanall = r(mean)
> */
. 
. matrix define transitions = J(7,4,.)

. 
. * Domestic workers who were not registered in the previous year
. 
. qui sum cont_pens if lcont_pens == 0 & domwk == 1 & gender == 0 & year == 2011

. matrix transitions[1,1] = round(r(mean),.001)

. 
. qui sum cont_pens if lcont_pens == 0 & domwk == 1 & gender == 0 & year == 2012

. matrix transitions[2,1] = round(r(mean),.001)

. 
. qui sum cont_pens if lcont_pens == 0 & domwk == 1 & gender == 0 & inlist(year,2011,2012)

. matrix transitions[3,1] = round(r(mean),.001)

. 
. qui sum cont_pens if lcont_pens == 0 & domwk == 1 & gender == 0 & year == 2013

. matrix transitions[4,1] = round(r(mean),.001)

. 
. qui sum cont_pens if lcont_pens == 0 & domwk == 1 & gender == 0 & year == 2014

. matrix transitions[5,1] = round(r(mean),.001)

. 
. qui sum cont_pens if lcont_pens == 0 & domwk == 1 & gender == 0 & year == 2015

. matrix transitions[6,1] = round(r(mean),.001)

. 
. qui sum cont_pens if lcont_pens == 0 & domwk == 1 & gender == 0 & inlist(year,2013,2014,2015)

. matrix transitions[7,1] = round(r(mean),.001)

. 
. 
. * Low-wage female workers who were not registered in the previous year
. 
. qui sum cont_pens if lcont_pens == 0 & domwk == 0 & ${ctrl_group} == 1 & gender == 0 & year == 2011

. matrix transitions[1,2] = round(r(mean),.001)

. 
. qui sum cont_pens if lcont_pens == 0 & domwk == 0 & ${ctrl_group} == 1 & gender == 0 & year == 2012

. matrix transitions[2,2] = round(r(mean),.001)

. 
. qui sum cont_pens if lcont_pens == 0 & domwk == 0 & ${ctrl_group} == 1 & gender == 0 & inlist(year,2011,2012)

. matrix transitions[3,2] = round(r(mean),.001)

. 
. qui sum cont_pens if lcont_pens == 0 & domwk == 0 & ${ctrl_group} == 1 & gender == 0 & year == 2013

. matrix transitions[4,2] = round(r(mean),.001)

. 
. qui sum cont_pens if lcont_pens == 0 & domwk == 0 & ${ctrl_group} == 1 & gender == 0 & year == 2014

. matrix transitions[5,2] = round(r(mean),.001)

. 
. qui sum cont_pens if lcont_pens == 0 & domwk == 0 & ${ctrl_group} == 1 & gender == 0 & year == 2015

. matrix transitions[6,2] = round(r(mean),.001)

. 
. qui sum cont_pens if lcont_pens == 0 & domwk == 0 & ${ctrl_group} == 1 & gender == 0 & inlist(year,2013,2014,2015)

. matrix transitions[7,2] = round(r(mean),.001)

. 
. 
. * Domestic workers who were registered in the previous year
. 
. qui sum cont_pens if lcont_pens == 1 & domwk == 1 & gender == 0 & year == 2011

. matrix transitions[1,3] = round(r(mean),.001)

. 
. qui sum cont_pens if lcont_pens == 1 & domwk == 1 & gender == 0 & year == 2012

. matrix transitions[2,3] = round(r(mean),.001)

. 
. qui sum cont_pens if lcont_pens == 1 & domwk == 1 & gender == 0 & inlist(year,2011,2012)

. matrix transitions[3,3] = round(r(mean),.001)

. 
. qui sum cont_pens if lcont_pens == 1 & domwk == 1 & gender == 0 & year == 2013

. matrix transitions[4,3] = round(r(mean),.001)

. 
. qui sum cont_pens if lcont_pens == 1 & domwk == 1 & gender == 0 & year == 2014

. matrix transitions[5,3] = round(r(mean),.001)

. 
. qui sum cont_pens if lcont_pens == 1 & domwk == 1 & gender == 0 & year == 2015

. matrix transitions[6,3] = round(r(mean),.001)

. 
. qui sum cont_pens if lcont_pens == 1 & domwk == 1 & gender == 0 & inlist(year,2013,2014,2015)

. matrix transitions[7,3] = round(r(mean),.001)

. 
. 
. * Low-wage female workers who were registered in the previous year
. 
. qui sum cont_pens if lcont_pens == 1 & domwk == 0 & ${ctrl_group} == 1 & gender == 0 & year == 2011

. matrix transitions[1,4] = round(r(mean),.001)

. 
. qui sum cont_pens if lcont_pens == 1 & domwk == 0 & ${ctrl_group} == 1 & gender == 0 & year == 2012

. matrix transitions[2,4] = round(r(mean),.001)

. 
. qui sum cont_pens if lcont_pens == 1 & domwk == 0 & ${ctrl_group} == 1 & gender == 0 & inlist(year,2011,2012)

. matrix transitions[3,4] = round(r(mean),.001)

. 
. qui sum cont_pens if lcont_pens == 1 & domwk == 0 & ${ctrl_group} == 1 & gender == 0 & year == 2013

. matrix transitions[4,4] = round(r(mean),.001)

. 
. qui sum cont_pens if lcont_pens == 1 & domwk == 0 & ${ctrl_group} == 1 & gender == 0 & year == 2014

. matrix transitions[5,4] = round(r(mean),.001)

. 
. qui sum cont_pens if lcont_pens == 1 & domwk == 0 & ${ctrl_group} == 1 & gender == 0 & year == 2015

. matrix transitions[6,4] = round(r(mean),.001)

. 
. qui sum cont_pens if lcont_pens == 1 & domwk == 0 & ${ctrl_group} == 1 & gender == 0 & inlist(year,2013,2014,2015)

. matrix transitions[7,4] = round(r(mean),.001)

. 
. * Write the names of rows and columns of the matrix
. 
. matrix rownames transitions = 2011 2012 "Average" 2013 2014 2015 "Average"

. //matrix colnames transitions = "Domestic workers" "Other workers" "Domestic workers" "Other workers"
. 
. * Export the matrix to Excel
. 
. putexcel set "$tables/Table A1_1", replace
Note: file will be replaced when the first putexcel command is issued

. 
. putexcel C1:D1, overwritefmt merge
file C:\Users\brian\Dropbox (Personal)\Research\Argentina - Domestic workers reform\Paper\Cluster at MSA\JHR\Accepted\Replication do files/Tables/Table A1_1.xlsx saved

. putexcel C1 = "Not registered the previous year", hcenter border(bottom, thin)
file C:\Users\brian\Dropbox (Personal)\Research\Argentina - Domestic workers reform\Paper\Cluster at MSA\JHR\Accepted\Replication do files/Tables/Table A1_1.xlsx saved

. putexcel (C1:D1), border(bottom, thin)
file C:\Users\brian\Dropbox (Personal)\Research\Argentina - Domestic workers reform\Paper\Cluster at MSA\JHR\Accepted\Replication do files/Tables/Table A1_1.xlsx saved

. 
. putexcel E1:F1, overwritefmt merge
file C:\Users\brian\Dropbox (Personal)\Research\Argentina - Domestic workers reform\Paper\Cluster at MSA\JHR\Accepted\Replication do files/Tables/Table A1_1.xlsx saved

. putexcel E1 = "Registered the previous year", hcenter border(bottom, thin)
file C:\Users\brian\Dropbox (Personal)\Research\Argentina - Domestic workers reform\Paper\Cluster at MSA\JHR\Accepted\Replication do files/Tables/Table A1_1.xlsx saved

. putexcel (E1:F1), border(bottom, thin)
file C:\Users\brian\Dropbox (Personal)\Research\Argentina - Domestic workers reform\Paper\Cluster at MSA\JHR\Accepted\Replication do files/Tables/Table A1_1.xlsx saved

. 
. putexcel A2 = "Period"
file C:\Users\brian\Dropbox (Personal)\Research\Argentina - Domestic workers reform\Paper\Cluster at MSA\JHR\Accepted\Replication do files/Tables/Table A1_1.xlsx saved

. putexcel B2 = "Year"
file C:\Users\brian\Dropbox (Personal)\Research\Argentina - Domestic workers reform\Paper\Cluster at MSA\JHR\Accepted\Replication do files/Tables/Table A1_1.xlsx saved

. putexcel C2 = "Domestic workers"
file C:\Users\brian\Dropbox (Personal)\Research\Argentina - Domestic workers reform\Paper\Cluster at MSA\JHR\Accepted\Replication do files/Tables/Table A1_1.xlsx saved

. putexcel D2 = "Other workers"
file C:\Users\brian\Dropbox (Personal)\Research\Argentina - Domestic workers reform\Paper\Cluster at MSA\JHR\Accepted\Replication do files/Tables/Table A1_1.xlsx saved

. putexcel E2 = "Domestic workers"
file C:\Users\brian\Dropbox (Personal)\Research\Argentina - Domestic workers reform\Paper\Cluster at MSA\JHR\Accepted\Replication do files/Tables/Table A1_1.xlsx saved

. putexcel F2 = "Other workers"
file C:\Users\brian\Dropbox (Personal)\Research\Argentina - Domestic workers reform\Paper\Cluster at MSA\JHR\Accepted\Replication do files/Tables/Table A1_1.xlsx saved

. 
. putexcel (A2:F2), border(bottom, medium)
file C:\Users\brian\Dropbox (Personal)\Research\Argentina - Domestic workers reform\Paper\Cluster at MSA\JHR\Accepted\Replication do files/Tables/Table A1_1.xlsx saved

. 
. putexcel A3:A5, overwritefmt merge
file C:\Users\brian\Dropbox (Personal)\Research\Argentina - Domestic workers reform\Paper\Cluster at MSA\JHR\Accepted\Replication do files/Tables/Table A1_1.xlsx saved

. putexcel A3 = "Pre-reform", vcenter
file C:\Users\brian\Dropbox (Personal)\Research\Argentina - Domestic workers reform\Paper\Cluster at MSA\JHR\Accepted\Replication do files/Tables/Table A1_1.xlsx saved

. 
. putexcel A6:A9, overwritefmt merge
file C:\Users\brian\Dropbox (Personal)\Research\Argentina - Domestic workers reform\Paper\Cluster at MSA\JHR\Accepted\Replication do files/Tables/Table A1_1.xlsx saved

. putexcel A6 = "Post-reform", vcenter
file C:\Users\brian\Dropbox (Personal)\Research\Argentina - Domestic workers reform\Paper\Cluster at MSA\JHR\Accepted\Replication do files/Tables/Table A1_1.xlsx saved

. 
. putexcel B3 = matrix(transitions), rownames overwritefmt nformat(#.000)
file C:\Users\brian\Dropbox (Personal)\Research\Argentina - Domestic workers reform\Paper\Cluster at MSA\JHR\Accepted\Replication do files/Tables/Table A1_1.xlsx saved

. 
. putexcel(A5:F5), border(bottom, thin)
file C:\Users\brian\Dropbox (Personal)\Research\Argentina - Domestic workers reform\Paper\Cluster at MSA\JHR\Accepted\Replication do files/Tables/Table A1_1.xlsx saved

. putexcel(A9:F9), border(bottom, medium)
file C:\Users\brian\Dropbox (Personal)\Research\Argentina - Domestic workers reform\Paper\Cluster at MSA\JHR\Accepted\Replication do files/Tables/Table A1_1.xlsx saved

. 
. putexcel save

. 
end of do-file

. do "$dir/(8) Table A1_2.do"

. ********************************************************************************
. ************************* Do File (8): Table A1.2 ******************************
. ********************************************************************************
. 
. clear

. matrix drop _all

. set more off

. 
. use "$data/EPH_1015_format.dta", clear

. 
. destring occupation occupation_unemp occup_all, replace
occupation: all characters numeric; replaced as long
(759813 missing values generated)
occupation_unemp: all characters numeric; replaced as long
(1246493 missing values generated)
occup_all: all characters numeric; replaced as long
(731803 missing values generated)

. 
. *** Keep only observations that have all controls used
. 
. keep if (occupation !=. & underemp != . & cont_pens !=. & domwk_all !=. & linc_mjob_base08 !=. & lwagehr_mjob_base08 !=. & linc_total_base08 != . & lhours_mjob !=. & age !=. 
> & hhsize !=. & tenure !=. & msa !=. & educyr !=. ///
> & attsch_ever !=. & native !=. & lit !=. & gender !=.) | (occupation_unemp != . & age !=. & hhsize !=. & msa !=. & educyr !=. & attsch_ever !=. & native !=. & lit !=. & gende
> r !=.)
(1,088,326 observations deleted)

. 
. ********************************************************************************
. ********************************************************************************
. 
. *** Locals for controls
. 
. local occup occupation

. local base_controls "msa year"

. local controls "age age2 hhsize lit native attsch_ever educyr educyr2 i.marstat i.dec_pcfaminc"

. 
. 
. *** Label the variables as they appear in the table
. 
. label var hours_mjob "Hours of work"

. label var lhours_mjob "Hours of work"

. 
. 
. ********************************************************************************
. ********************************************************************************
. 
. *** Create the full-time dummies
. 
. gen fulltime35 = hours_mjob >= 35 & !missing(hours_mjob)

. label var fulltime35 "Full-time worker"

. 
. gen fulltime30 = hours_mjob >= 30 & !missing(hours_mjob)

. label var fulltime30 "Full-time worker"

. 
. ********************************************************************************
. ********************************************************************************
. ********************************************************************************
. ********************************************************************************
. 
. * Run regression for pension contribution to restrict the sample to use
. 
. qui reghdfe cont_pens domwk_all treat_dwall `controls' if ${ctrl_group} == 1 & unemployed == 0, absorb(`base_controls' `occup') vce(cluster msa)

. gen sample_reg = 1 if e(sample)
(131,215 missing values generated)

. 
. * Full time worker defined as those who work 30 hours or more
. 
. local varlabel: variable label fulltime30

. qui reghdfe fulltime30 domwk_all treat_dwall `controls' if sample_reg == 1, absorb(`base_controls' `occup') vce(cluster msa)

. sum fulltime30 if domwk_all == 1 & treat == 0 & e(sample)

    Variable |        Obs        Mean    Std. Dev.       Min        Max
-------------+---------------------------------------------------------
  fulltime30 |     19,174    .3542297    .4782917          0          1

. local meanvar = r(mean)

. outreg2 using "$tables/Table A1_2", replace excel keep(treat_dwall) nocons dec(3) label ctitle(`varlabel') addstat(Mean dependent variable,`meanvar') addtext(Controls, Yes, Y
> ear Fixed Effects, Yes, Occupation Fixed Effects, Yes, Metropolitan Area Fixed Effects, Yes, Number of clusters, "`e(N_clust)'")
C:\Users\brian\Dropbox (Personal)\Research\Argentina - Domestic workers reform\Paper\Cluster at MSA\JHR\Accepted\Replication do files/Tables/Table A1_2.xml
dir : seeout

. 
. local varlabel: variable label hours_mjob

. qui reghdfe lhours_mjob domwk_all treat_dwall `controls' if sample_reg == 1 & fulltime30 == 0, absorb(`base_controls' `occup') vce(cluster msa)

. sum hours_mjob if domwk_all == 1 & treat == 0 & e(sample)

    Variable |        Obs        Mean    Std. Dev.       Min        Max
-------------+---------------------------------------------------------
  hours_mjob |     12,382    14.98159    6.936882          1         29

. local meanvar = r(mean)

. outreg2 using "$tables/Table A1_2", append excel keep(treat_dwall) nocons dec(3) label ctitle(`varlabel') addstat(Mean dependent variable,`meanvar') addtext(Type of worker, P
> art-time, Controls, Yes,Year Fixed Effects, Yes, Occupation Fixed Effects, Yes, Metropolitan Area Fixed Effects, Yes, Number of clusters, "`e(N_clust)'")
C:\Users\brian\Dropbox (Personal)\Research\Argentina - Domestic workers reform\Paper\Cluster at MSA\JHR\Accepted\Replication do files/Tables/Table A1_2.xml
dir : seeout

. 
. local varlabel: variable label hours_mjob

. qui reghdfe lhours_mjob domwk_all treat_dwall `controls' if sample_reg == 1 & fulltime30 == 1, absorb(`base_controls' `occup') vce(cluster msa)

. sum hours_mjob if domwk_all == 1 & treat == 0 & e(sample)

    Variable |        Obs        Mean    Std. Dev.       Min        Max
-------------+---------------------------------------------------------
  hours_mjob |      6,792    42.29814    12.56667         30         84

. local meanvar = r(mean)

. outreg2 using "$tables/Table A1_2", append excel keep(treat_dwall) nocons dec(3) label ctitle(`varlabel') addstat(Mean dependent variable,`meanvar') addtext(Type of worker, P
> art-time, Controls, Yes,Year Fixed Effects, Yes, Occupation Fixed Effects, Yes, Metropolitan Area Fixed Effects, Yes, Number of clusters, "`e(N_clust)'")
C:\Users\brian\Dropbox (Personal)\Research\Argentina - Domestic workers reform\Paper\Cluster at MSA\JHR\Accepted\Replication do files/Tables/Table A1_2.xml
dir : seeout

. 
. 
. * Full time worker defined as those who work 35 hours or more
. 
. local varlabel: variable label fulltime35

. qui reghdfe fulltime30 domwk_all treat_dwall `controls' if sample_reg == 1, absorb(`base_controls' `occup') vce(cluster msa)

. sum fulltime30 if domwk_all == 1 & treat == 0 & e(sample)

    Variable |        Obs        Mean    Std. Dev.       Min        Max
-------------+---------------------------------------------------------
  fulltime30 |     19,174    .3542297    .4782917          0          1

. local meanvar = r(mean)

. outreg2 using "$tables/Table A1_2", append excel keep(treat_dwall) nocons dec(3) label ctitle(`varlabel') addstat(Mean dependent variable,`meanvar') addtext(Controls, Yes, Ye
> ar Fixed Effects, Yes, Occupation Fixed Effects, Yes, Metropolitan Area Fixed Effects, Yes, Number of clusters, "`e(N_clust)'")
C:\Users\brian\Dropbox (Personal)\Research\Argentina - Domestic workers reform\Paper\Cluster at MSA\JHR\Accepted\Replication do files/Tables/Table A1_2.xml
dir : seeout

. 
. local varlabel: variable label hours_mjob

. qui reghdfe lhours_mjob domwk_all treat_dwall `controls' if sample_reg == 1 & fulltime35 == 0, absorb(`base_controls' `occup') vce(cluster msa)

. sum hours_mjob if domwk_all == 1 & treat == 0 & e(sample)

    Variable |        Obs        Mean    Std. Dev.       Min        Max
-------------+---------------------------------------------------------
  hours_mjob |     14,208    16.93926    8.246017          1         34

. local meanvar = r(mean)

. outreg2 using "$tables/Table A1_2", append excel keep(treat_dwall) nocons dec(3) label ctitle(`varlabel') addstat(Mean dependent variable,`meanvar') addtext(Type of worker, P
> art-time, Controls, Yes,Year Fixed Effects, Yes, Occupation Fixed Effects, Yes, Metropolitan Area Fixed Effects, Yes, Number of clusters, "`e(N_clust)'")
C:\Users\brian\Dropbox (Personal)\Research\Argentina - Domestic workers reform\Paper\Cluster at MSA\JHR\Accepted\Replication do files/Tables/Table A1_2.xml
dir : seeout

. 
. local varlabel: variable label hours_mjob

. qui reghdfe lhours_mjob domwk_all treat_dwall `controls' if sample_reg == 1 & fulltime35 == 1, absorb(`base_controls' `occup') vce(cluster msa)

. sum hours_mjob if domwk_all == 1 & treat == 0 & e(sample)

    Variable |        Obs        Mean    Std. Dev.       Min        Max
-------------+---------------------------------------------------------
  hours_mjob |      4,966    46.74144    11.93085         35         84

. local meanvar = r(mean)

. outreg2 using "$tables/Table A1_2", append excel keep(treat_dwall) nocons dec(3) label ctitle(`varlabel') addstat(Mean dependent variable,`meanvar') addtext(Type of worker, P
> art-time, Controls, Yes,Year Fixed Effects, Yes, Occupation Fixed Effects, Yes, Metropolitan Area Fixed Effects, Yes, Number of clusters, "`e(N_clust)'")
C:\Users\brian\Dropbox (Personal)\Research\Argentina - Domestic workers reform\Paper\Cluster at MSA\JHR\Accepted\Replication do files/Tables/Table A1_2.xml
dir : seeout

. 
end of do-file

. 
end of do-file

. exit, clear
